@jsenv/urls
Advanced tools
Comparing version 1.2.8 to 2.0.0
{ | ||
"name": "@jsenv/urls", | ||
"version": "1.2.8", | ||
"version": "2.0.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
import { urlToRelativeUrl } from "./url_to_relative_url.js" | ||
export const moveUrl = ({ url, from, to, preferAbsolute = false }) => { | ||
export const moveUrl = ({ url, from, to, preferRelative }) => { | ||
let relativeUrl = urlToRelativeUrl(url, from) | ||
@@ -10,6 +10,6 @@ if (relativeUrl.slice(0, 2) === "//") { | ||
const absoluteUrl = new URL(relativeUrl, to).href | ||
if (preferAbsolute) { | ||
return absoluteUrl | ||
if (preferRelative) { | ||
return urlToRelativeUrl(absoluteUrl, to) | ||
} | ||
return urlToRelativeUrl(absoluteUrl, to) | ||
return absoluteUrl | ||
} |
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
23215