New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to keep trailing slash in all cases #119
Comments
Why does it matter? There are many things this package does that change the input. That's the whole point of it. What's your use-case for needing this?
Yes, it would have to be a separate option. |
Yeah and I have those all turned off for my case. But this trailing slash stripping is the only one I can not turn off.
I'm using this module to URI-encode URL segments, punycode IDNs and get rid of double-URL-encoding which are all valuable adjustments in itself. I think stripping the trailing slash is a opinionated change that even goes against WHATWG recommendations to always have Ultimately, my URLs are going to end up in a HTTP |
Maybe we could add a third value |
Alright. I'm open to adding something for this. |
I don't think that would be clear enough. |
Any better ideas for overloading |
Decided it's better to have a separate option than to overload a boolean type with non-boolean values. Fixes: sindresorhus#119
Decided it's better to have a separate option than to overload a boolean type with non-boolean values. Fixes: sindresorhus#119
Decided it's better to have a separate option than to overload a boolean type with non-boolean values. Fixes: sindresorhus#119
Decided it's better to have a separate option than to overload a boolean type with non-boolean values. Fixes: sindresorhus#119
Decided it's better to have a separate option than to overload a boolean type with non-boolean values. Fixes: sindresorhus#119
I'd like to keep the output of this module as close as possible to the input and that means to also retain a
pathname
of/
in a case like this:While I generally think
removeTrailingSlash: false
should not remove any slashes inpathname
, I could see a option likekeepTrailingSlashOnEmptyPath
being added for compatibilty.This option would be useful because it is hard to work around because
URL()
will always output apathname
of/
regardless whether that slash is present or not:The text was updated successfully, but these errors were encountered: