Comparing version 5.0.3 to 5.0.4
@@ -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" |
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
12424
48
+ Addednormalize-url@4.5.0(transitive)
- Removednormalize-url@6.1.0(transitive)
Updatednormalize-url@4.5.0