diff --git a/index.js b/index.js index f8297f5..4727186 100644 --- a/index.js +++ b/index.js @@ -120,8 +120,38 @@ export default function normalizeUrl(urlString, options) { } // Remove duplicate slashes if not preceded by a protocol + // NOTE: This could be implemented using a single negative lookbehind + // regex, but we avoid that to maintain compatibility with older js engines + // which do not have support for that feature. if (urlObject.pathname) { - urlObject.pathname = urlObject.pathname.replace(/(?