normalize-url
normalize-url copied to clipboard
Normalize a URL
In the Docs, you have an example that has a port on a url and then when you wrap the url with "normalizeUrl" the port is no longer included: When...
Since we can't use ESM, but this bug breaks Safari for us we would like to have a `6.1.1` version with this fix. Fixes this - https://github.com/sindresorhus/normalize-url/issues/168
We are using version `v6.1.0` and can't upgrade since we still can't use pure ESM. However this version is incompatible with Safari, and we are kind of stuck here. Can...
I may be oversimplifying here, but this feels like a bug fix to not apply the protocol prefix when a custom prefix is present. Retains existing functionality and adds support...
The current behavior of `urlObject.pathname = decodeURI(urlObject.pathname); ` doesn't work as expected. Since URL automatically always encode any value that we set, according to https://developer.mozilla.org/en-US/docs/Web/API/URL `URLs are encoded according to...
See https://github.com/sindresorhus/normalize-url/pull/132 and the feedback given there.
### Test in browser https://github.com/sindresorhus/normalize-url/blob/3fb24bb03e340162b2e81d6145de8e4e5b3d6262/test.js#L40 ### Expected ```js normalizeUrl=(await import('https://cdn.jsdelivr.net/npm/[email protected]/index.js')).default normalizeUrl('sindre://www.sorhus.com') ``` ```txt "sindre://www.sorhus.com" ``` ### Actual ```js normalizeUrl=(await import('https://cdn.jsdelivr.net/npm/[email protected]/index.js')).default normalizeUrl('sindre://www.sorhus.com') ``` ```txt "sindre:/www.sorhus.com" ``` ### Related rejected fork https://github.com/loynoir/normalize-url
Thoughts on adding a feature to require TLD's in the url? It would raise an error on `http://google` but not `http://google.com` or `http://google.abcdefg` I can make a PR if that...
`foo:bar` is automatically converted into `http:foo:bar` by this lib.
When trying to strip `www.` from link with subdomain (e.g. `www.unix.stackexchange.com`) it does not work, `www.` stays. Is this intended behavior?