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

parse-url

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-url - npm Package Compare versions

Comparing version 5.0.3 to 5.0.4

24

lib/index.js

@@ -1,8 +0,6 @@

"use strict";
"use strict"
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
const parsePath = require("parse-path")
, normalizeUrl = require("normalize-url")
var parsePath = require("parse-path"),
normalizeUrl = require("normalize-url");
/**

@@ -37,20 +35,18 @@ * parseUrl

*/
function parseUrl(url) {
var normalize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
function parseUrl(url, normalize = false) {
if (typeof url !== "string" || !url.trim()) {
throw new Error("Invalid url.");
throw new Error("Invalid url.")
}
if (normalize) {
if ((typeof normalize === "undefined" ? "undefined" : _typeof(normalize)) !== "object") {
if (typeof normalize !== "object") {
normalize = {
stripFragment: false
};
}
}
url = normalizeUrl(url, normalize);
url = normalizeUrl(url, normalize)
}
var parsed = parsePath(url);
const parsed = parsePath(url)
return parsed;
}
module.exports = parseUrl;
module.exports = parseUrl;
{
"name": "parse-url",
"version": "5.0.3",
"version": "5.0.4",
"description": "An advanced url parser supporting git urls too.",

@@ -35,3 +35,3 @@ "main": "lib/index.js",

"is-ssh": "^1.3.0",
"normalize-url": "^6.0.1",
"normalize-url": "4.5.0",
"parse-path": "^4.0.0",

@@ -38,0 +38,0 @@ "protocols": "^1.4.0"

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