@vercel/routing-utils
Advanced tools
Comparing version 1.11.1-canary.0 to 1.11.1-canary.1
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -13,6 +10,2 @@ exports.sourceToRegex = exports.convertTrailingSlash = exports.convertHeaders = exports.convertRewrites = exports.convertRedirects = exports.convertCleanUrls = exports.getCleanUrls = void 0; | ||
const path_to_regexp_1 = require("path-to-regexp"); | ||
// @ts-ignore | ||
const lexer_1 = __importDefault(require("regexr/lexer-dist/lexer")); | ||
// @ts-ignore | ||
const profiles_1 = __importDefault(require("regexr/lexer-dist/profiles")); | ||
const UN_NAMED_SEGMENT = '__UN_NAMED_SEGMENT__'; | ||
@@ -179,2 +172,3 @@ function getCleanUrls(filePaths) { | ||
exports.sourceToRegex = sourceToRegex; | ||
const namedGroupsRegex = /\(\?<([a-zA-Z][a-zA-Z0-9]*)>/g; | ||
function collectHasSegments(has) { | ||
@@ -187,9 +181,7 @@ const hasSegments = new Set(); | ||
if (hasItem.value) { | ||
const matcher = new RegExp(`^${hasItem.value}$`); | ||
const lexer = new lexer_1.default(); | ||
lexer.profile = profiles_1.default.js; | ||
lexer.parse(`/${matcher.source}/`); | ||
Object.keys(lexer.namedGroups).forEach(groupKey => { | ||
hasSegments.add(groupKey); | ||
}); | ||
for (const match of hasItem.value.matchAll(namedGroupsRegex)) { | ||
if (match[1]) { | ||
hasSegments.add(match[1]); | ||
} | ||
} | ||
if (hasItem.type === 'host') { | ||
@@ -196,0 +188,0 @@ hasSegments.add('host'); |
{ | ||
"name": "@vercel/routing-utils", | ||
"version": "1.11.1-canary.0", | ||
"version": "1.11.1-canary.1", | ||
"description": "Vercel routing utilities", | ||
@@ -23,4 +23,3 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"path-to-regexp": "6.1.0", | ||
"regexr": "https://github.com/ijjk/regexr-lexer.git#3bcf3d1c4bc6dd9239c47acb1fb7b419823f8337" | ||
"path-to-regexp": "6.1.0" | ||
}, | ||
@@ -35,3 +34,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "6d8b10802c8e577a20762c8fb6e0f7b18991712d" | ||
"gitHead": "e28edc5c93418bd65f675dc841a2bf0cf52b4572" | ||
} |
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
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
2
0
0
74050
1595