function getUrl(url) {
  const { protocol, hostname, pathname, port } = getLocation(url)
  return `${protocol}://${hostname}${(port) ? `:${port}` : '' }${trimTrailingSlash(pathname)}`
}
Get clean URL from a URL string
@param  {String} [url] - href of page, window.location.href will be used by default
@return {String} URL of page with no search/hash

@example
 getUrl('https://subdomain.my-site.com/path-to/page/here/?param=true#hash=false')
 > https://subdomain.my-site.com/path-to/page/here