@jsenv/urls
Advanced tools
Comparing version 2.4.0 to 2.4.1
{ | ||
"name": "@jsenv/urls", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"license": "MIT", | ||
@@ -31,4 +31,4 @@ "repository": { | ||
"dependencies": { | ||
"@jsenv/humanize": "1.2.5" | ||
"@jsenv/humanize": "1.2.6" | ||
} | ||
} |
@@ -43,1 +43,3 @@ // tslint:disable:ordered-imports | ||
export { urlToScheme } from "./url_to_scheme.js"; | ||
export { getCommonPathname } from "./common_pathname.js"; |
import { getCommonPathname } from "./common_pathname.js"; | ||
export const urlToRelativeUrl = (url, baseUrl) => { | ||
export const urlToRelativeUrl = ( | ||
url, | ||
baseUrl, | ||
{ preferRelativeNotation } = {}, | ||
) => { | ||
const urlObject = new URL(url); | ||
@@ -47,3 +51,3 @@ const baseUrlObject = new URL(baseUrl); | ||
const relativeUrl = `${specificPathname}${search}${hash}`; | ||
return relativeUrl; | ||
return preferRelativeNotation ? `./${relativeUrl}` : relativeUrl; | ||
}; | ||
@@ -50,0 +54,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
21923
628
+ Added@jsenv/humanize@1.2.6(transitive)
- Removed@jsenv/humanize@1.2.5(transitive)
Updated@jsenv/humanize@1.2.6