normalize-url
Advanced tools
Comparing version 5.2.0 to 5.2.1
@@ -178,5 +178,11 @@ 'use strict'; | ||
const oldUrlString = urlString; | ||
// Take advantage of many of the Node `url` normalizations | ||
urlString = urlObj.toString(); | ||
if (!options.removeSingleSlash && urlObj.pathname === '/' && !oldUrlString.endsWith('/') && urlObj.hash === '') { | ||
urlString = urlString.replace(/\/$/, ''); | ||
} | ||
// Remove ending `/` unless removeSingleSlash is false | ||
@@ -183,0 +189,0 @@ if ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '' && options.removeSingleSlash) { |
{ | ||
"name": "normalize-url", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"description": "Normalize a URL", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
18416
333