@jsenv/urls
Advanced tools
Comparing version 2.5.0 to 2.5.1
{ | ||
"name": "@jsenv/urls", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
import { urlToFilename } from "./url_to_filename.js"; | ||
export const urlToBasename = (url) => { | ||
export const urlToBasename = (url, removeAllExtensions) => { | ||
const filename = urlToFilename(url); | ||
return filenameToBasename(filename); | ||
const basename = filenameToBasename(filename); | ||
if (!removeAllExtensions) { | ||
return basename; | ||
} | ||
let currentBasename = basename; | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
const nextBasename = filenameToBasename(basename); | ||
if (nextBasename === currentBasename) { | ||
return currentBasename; | ||
} | ||
currentBasename = nextBasename; | ||
} | ||
}; | ||
@@ -7,0 +19,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
24280
703