urlpattern-polyfill
Advanced tools
Comparing version 6.0.1 to 6.0.2
@@ -451,3 +451,6 @@ // src/path-to-regex-modified.ts | ||
const leadingSlash = pathname[0] == "/"; | ||
pathname = new URL(!leadingSlash ? "/-" + pathname : pathname, "https://example.com").pathname; | ||
pathname = new URL( | ||
!leadingSlash ? "/-" + pathname : pathname, | ||
"https://example.com" | ||
).pathname; | ||
if (!leadingSlash) { | ||
@@ -869,2 +872,8 @@ pathname = pathname.substring(2, pathname.length); | ||
} | ||
function processBaseURLString(input, isPattern) { | ||
if (!isPattern) { | ||
return input; | ||
} | ||
return escapePatternString(input); | ||
} | ||
function applyInit(o, init, isPattern) { | ||
@@ -875,10 +884,10 @@ let baseURL; | ||
baseURL = new URL(init.baseURL); | ||
o.protocol = baseURL.protocol ? baseURL.protocol.substring(0, baseURL.protocol.length - 1) : ""; | ||
o.username = baseURL.username; | ||
o.password = baseURL.password; | ||
o.hostname = baseURL.hostname; | ||
o.port = baseURL.port; | ||
o.pathname = baseURL.pathname; | ||
o.search = baseURL.search ? baseURL.search.substring(1, baseURL.search.length) : ""; | ||
o.hash = baseURL.hash ? baseURL.hash.substring(1, baseURL.hash.length) : ""; | ||
o.protocol = processBaseURLString(baseURL.protocol.substring(0, baseURL.protocol.length - 1), isPattern); | ||
o.username = processBaseURLString(baseURL.username, isPattern); | ||
o.password = processBaseURLString(baseURL.password, isPattern); | ||
o.hostname = processBaseURLString(baseURL.hostname, isPattern); | ||
o.port = processBaseURLString(baseURL.port, isPattern); | ||
o.pathname = processBaseURLString(baseURL.pathname, isPattern); | ||
o.search = processBaseURLString(baseURL.search.substring(1, baseURL.search.length), isPattern); | ||
o.hash = processBaseURLString(baseURL.hash.substring(1, baseURL.hash.length), isPattern); | ||
} catch { | ||
@@ -908,3 +917,3 @@ throw new TypeError(`invalid baseURL '${init.baseURL}'.`); | ||
if (slashIndex >= 0) { | ||
o.pathname = baseURL.pathname.substring(0, slashIndex + 1) + o.pathname; | ||
o.pathname = processBaseURLString(baseURL.pathname.substring(0, slashIndex + 1), isPattern) + o.pathname; | ||
} | ||
@@ -911,0 +920,0 @@ } |
{ | ||
"name": "urlpattern-polyfill", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"description": "Polyfill for the URLPattern API", | ||
@@ -42,7 +42,7 @@ "repository": { | ||
"@ava/typescript": "^3.0.1", | ||
"ava": "^4.1.0", | ||
"ava": "^5.1.0", | ||
"esbuild": "^0.14.31", | ||
"rimraf": "^3.0.2", | ||
"typescript": "^4.7.2", | ||
"wireit": "^0.4.3" | ||
"wireit": "^0.7.3" | ||
}, | ||
@@ -141,3 +141,6 @@ "ava": { | ||
"author": "", | ||
"license": "MIT" | ||
"license": "MIT", | ||
"dependencies": { | ||
"braces": "^3.0.2" | ||
} | ||
} |
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
89436
2521
1
+ Addedbraces@^3.0.2
+ Addedbraces@3.0.3(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)