@jridgewell/resolve-uri
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -17,3 +17,3 @@ (function (global, factory) { | ||
*/ | ||
const urlRegex = /^([\w+.-]+:)\/\/([^@]*@)?([^:/]+)(:\d+)?(\/[^#?]*)?/; | ||
const urlRegex = /^([\w+.-]+:)\/\/([^@]*@)?([^:/]*)(:\d+)?(\/[^#?]*)?/; | ||
function isAbsoluteUrl(input) { | ||
@@ -153,3 +153,3 @@ return schemeRegex.test(input); | ||
// If there's no host, then we were just a path. | ||
if (!url.host) { | ||
if (!url.host || baseUrl.scheme === 'file:') { | ||
// The host, user, and port are joined, you can't copy one without the others. | ||
@@ -176,3 +176,3 @@ url.user = baseUrl.user; | ||
// If there's no host (and no scheme/user/port), then we need to output an absolute path. | ||
if (!url.host) | ||
if (!url.scheme && !url.host) | ||
return url.path; | ||
@@ -179,0 +179,0 @@ // We're outputting either an absolute URL, or a protocol relative one. |
{ | ||
"name": "@jridgewell/resolve-uri", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Resolve a URI relative to an optional base URI", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
42251