* Returns the given URL without searchParams and hash. * @param {URL} url the URL as object * @return {URL} the url without searchParams and hash
(url)
| 132 | * @return {URL} the url without searchParams and hash |
| 133 | */ |
| 134 | function urlWithoutParamsAndHash(url) { |
| 135 | let newURL = url.toString(); |
| 136 | |
| 137 | if (url.search) { |
| 138 | newURL = newURL.replace(url.search, ""); |
| 139 | } |
| 140 | |
| 141 | if (url.hash) { |
| 142 | newURL = newURL.replace(url.hash, ""); |
| 143 | } |
| 144 | |
| 145 | return new URL(newURL); |
| 146 | } |
| 147 | |
| 148 | /** |
| 149 | * Load local saved data, if the browser is offline or |
no test coverage detected