sindresorhus / normalize-url

Normalize a URL
MIT License
837 stars 123 forks source link

remove paths ending with / with removeDirectoryIndex #190

Open millette opened 2 months ago

millette commented 2 months ago

I had example.com/fr and I can remove the "/fr" part with removeDirectoryIndex. I also wanted to remove "/fr/" from example.com/fr/ but since it ends with a slash (and removeTrailingSlash doesn't help here) I can't remove that path suffix.