Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2021-08-11 14:28:28 +00:00
parent 5fd8ca8122
commit 1e0763ca30
2 changed files with 36 additions and 5 deletions

32
node_modules/normalize-url/index.js generated vendored
View file

@ -120,8 +120,38 @@ export default function normalizeUrl(urlString, options) {
}
// Remove duplicate slashes if not preceded by a protocol
// NOTE: This could be implemented using a single negative lookbehind
// regex, but we avoid that to maintain compatibility with older js engines
// which do not have support for that feature.
if (urlObject.pathname) {
urlObject.pathname = urlObject.pathname.replace(/(?<!\b[a-z][a-z\d+\-.]{1,50}:)\/{2,}/g, '/');
// TODO: Replace everything below with `urlObject.pathname = urlObject.pathname.replace(/(?<!\b[a-z][a-z\d+\-.]{1,50}:)\/{2,}/g, '/');` when Safari supports negative lookbehind.
// Split the string by occurrences of this protocol regex, and perform
// duplicate-slash replacement on the strings between those occurrences
// (if any).
const protocolRegex = /\b[a-z][a-z\d+\-.]{1,50}:\/\//g;
let lastIndex = 0;
let result = '';
for (;;) {
const match = protocolRegex.exec(urlObject.pathname);
if (!match) {
break;
}
const protocol = match[0];
const protocolAtIndex = match.index;
const intermediate = urlObject.pathname.slice(lastIndex, protocolAtIndex);
result += intermediate.replace(/\/{2,}/g, '/');
result += protocol;
lastIndex = protocolAtIndex + protocol.length;
}
const remnant = urlObject.pathname.slice(lastIndex, urlObject.pathname.length);
result += remnant.replace(/\/{2,}/g, '/');
urlObject.pathname = result;
}
// Decode URI octets

View file

@ -1,6 +1,6 @@
{
"name": "normalize-url",
"version": "7.0.0",
"version": "7.0.1",
"description": "Normalize a URL",
"license": "MIT",
"repository": "sindresorhus/normalize-url",
@ -16,7 +16,7 @@
"node": ">=12.20"
},
"scripts": {
"test": "xo && nyc ava && tsd"
"test": "xo && c8 ava && tsd"
},
"files": [
"index.js",
@ -39,11 +39,12 @@
],
"devDependencies": {
"ava": "^3.15.0",
"nyc": "^15.1.0",
"c8": "^7.7.3",
"tsd": "^0.17.0",
"typescript": "^4.3.5",
"xo": "^0.41.0"
},
"nyc": {
"c8": {
"reporter": [
"text",
"lcov"