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