function urlParse(str = '') {
  if (/^\w+:\/\//.test(str)) {
    return new URL(str);
  }

  if (/^\/\//.test(str)) {
    return new URL(str, 'https://ba.se');
  }

  return {pathname: str};
}
Parse Url
@param {string} str The URL
@returns {URL|object} return new URL Object