@jsenv/urls
Advanced tools
Comparing version 2.3.1 to 2.3.2
{ | ||
"name": "@jsenv/urls", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -147,3 +147,11 @@ import { urlToExtension } from "./url_to_extension.js"; | ||
: pathname; | ||
const newPathname = `${pathnameWithoutExtension}${extension}`; | ||
let newPathname; | ||
if (pathnameWithoutExtension.endsWith("/")) { | ||
newPathname = pathnameWithoutExtension.slice(0, -1); | ||
newPathname += extension; | ||
newPathname += "/"; | ||
} else { | ||
newPathname = pathnameWithoutExtension; | ||
newPathname += extension; | ||
} | ||
return `${origin}${newPathname}${search ? `?${search}` : ""}`; | ||
@@ -150,0 +158,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21282
613