Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jsenv/urls

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsenv/urls - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

2

package.json
{
"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) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc