@vercel/routing-utils
Advanced tools
Comparing version 5.0.2 to 5.0.3
@@ -32,34 +32,3 @@ "use strict"; | ||
var import_url = require("url"); | ||
var import_path_to_regexp = require("path-to-regexp"); | ||
var import_path_to_regexp_updated = require("path-to-regexp-updated"); | ||
function pathToRegexp(callerId, path, keys, options) { | ||
const currentRegExp = (0, import_path_to_regexp.pathToRegexp)(path, keys, options); | ||
try { | ||
const currentKeys = keys; | ||
const newKeys = []; | ||
const newRegExp = (0, import_path_to_regexp_updated.pathToRegexp)(path, newKeys, options); | ||
const isDiffRegExp = currentRegExp.toString() !== newRegExp.toString(); | ||
if (process.env.FORCE_PATH_TO_REGEXP_LOG || isDiffRegExp) { | ||
const message = JSON.stringify({ | ||
path, | ||
currentRegExp: currentRegExp.toString(), | ||
newRegExp: newRegExp.toString() | ||
}); | ||
console.error(`[vc] PATH TO REGEXP PATH DIFF @ #${callerId}: ${message}`); | ||
} | ||
const isDiffKeys = keys?.toString() !== newKeys?.toString(); | ||
if (process.env.FORCE_PATH_TO_REGEXP_LOG || isDiffKeys) { | ||
const message = JSON.stringify({ | ||
isDiffKeys, | ||
currentKeys, | ||
newKeys | ||
}); | ||
console.error(`[vc] PATH TO REGEXP KEYS DIFF @ #${callerId}: ${message}`); | ||
} | ||
} catch (err) { | ||
const error = err; | ||
console.error(`[vc] PATH TO REGEXP ERROR @ #${callerId}: ${error.message}`); | ||
} | ||
return currentRegExp; | ||
} | ||
var import_path_to_regexp = require("@vercel-internals/path-to-regexp"); | ||
const UN_NAMED_SEGMENT = "__UN_NAMED_SEGMENT__"; | ||
@@ -220,3 +189,3 @@ function getCleanUrls(filePaths) { | ||
const keys = []; | ||
const r = pathToRegexp("632", source, keys, { | ||
const r = (0, import_path_to_regexp.pathToRegexp)("632", source, keys, { | ||
strict: true, | ||
@@ -294,5 +263,5 @@ sensitive: true, | ||
try { | ||
pathToRegexp("528", pathname, pathnameKeys); | ||
pathToRegexp("834", hash || "", hashKeys); | ||
pathToRegexp("712", hostname || "", hostnameKeys); | ||
(0, import_path_to_regexp.pathToRegexp)("528", pathname, pathnameKeys); | ||
(0, import_path_to_regexp.pathToRegexp)("834", hash || "", hashKeys); | ||
(0, import_path_to_regexp.pathToRegexp)("712", hostname || "", hostnameKeys); | ||
} catch (_) { | ||
@@ -299,0 +268,0 @@ } |
{ | ||
"name": "@vercel/routing-utils", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "Vercel routing utilities", | ||
@@ -16,9 +16,7 @@ "main": "./dist/index.js", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"path-to-regexp-updated": "npm:path-to-regexp@6.3.0", | ||
"path-to-regexp": "6.1.0" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@types/jest": "27.4.1", | ||
"@types/node": "14.18.33", | ||
"@vercel-internals/path-to-regexp": "1.0.0", | ||
"ajv": "^6.12.3", | ||
@@ -25,0 +23,0 @@ "jest-junit": "16.0.0", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1
0
101065
6
2426
- Removedpath-to-regexp@6.1.0
- Removedpath-to-regexp@6.1.06.3.0(transitive)