removeSingleSlash should default to false
Closed this issue · 1 comments
https://github.com/sindresorhus/normalize-url#removesingleslash
removeSingleSlash
Type: boolean
Default: true
Remove a sole / pathname in the output. This option is independent of
removeTrailingSlash
.
Looking at https://www.rfc-editor.org/rfc/rfc3986#section-6.2.3
http://example.com
http://example.com/
http://example.com:/
http://example.com:80/
In general, a URI that uses the generic syntax for authority with an empty path should be normalized to a path of "/".
[...]
For example, the second URI above is the normal form for the "HTTP" scheme.
Which is the http://example.com/
version
http://example.com
and http://example.com/
are equivalent. I'm not sure of their reasoning for preserving /
, but I prefer without the /
, as it's cleaner, and this package is often used for presenting URLs, not just comparisons. I don't have any plans to change the defaults.