@vercel/routing-utils
Advanced tools
Comparing version 2.1.2 to 2.1.3
@@ -44,2 +44,4 @@ "use strict"; | ||
const hasSegments = collectHasSegments(r.has); | ||
normalizeHasKeys(r.has); | ||
normalizeHasKeys(r.missing); | ||
try { | ||
@@ -65,2 +67,5 @@ const loc = replaceSegments(segments, hasSegments, r.destination, true); | ||
} | ||
if (r.missing) { | ||
route.missing = r.missing; | ||
} | ||
return route; | ||
@@ -78,2 +83,4 @@ } | ||
const hasSegments = collectHasSegments(r.has); | ||
normalizeHasKeys(r.has); | ||
normalizeHasKeys(r.missing); | ||
try { | ||
@@ -85,2 +92,5 @@ const dest = replaceSegments(segments, hasSegments, r.destination, false, internalParamNames); | ||
} | ||
if (r.missing) { | ||
route.missing = r.missing; | ||
} | ||
return route; | ||
@@ -99,2 +109,4 @@ } | ||
const hasSegments = collectHasSegments(h.has); | ||
normalizeHasKeys(h.has); | ||
normalizeHasKeys(h.missing); | ||
const namedSegments = segments.filter(name => name !== UN_NAMED_SEGMENT); | ||
@@ -127,2 +139,5 @@ const indexes = {}; | ||
} | ||
if (h.missing) { | ||
route.missing = h.missing; | ||
} | ||
return route; | ||
@@ -178,8 +193,13 @@ }); | ||
const namedGroupsRegex = /\(\?<([a-zA-Z][a-zA-Z0-9]*)>/g; | ||
const normalizeHasKeys = (hasItems = []) => { | ||
for (const hasItem of hasItems) { | ||
if ('key' in hasItem && hasItem.type === 'header') { | ||
hasItem.key = hasItem.key.toLowerCase(); | ||
} | ||
} | ||
return hasItems; | ||
}; | ||
function collectHasSegments(has) { | ||
const hasSegments = new Set(); | ||
for (const hasItem of has || []) { | ||
if ('key' in hasItem && hasItem.type === 'header') { | ||
hasItem.key = hasItem.key.toLowerCase(); | ||
} | ||
if (!hasItem.value && 'key' in hasItem) { | ||
@@ -186,0 +206,0 @@ hasSegments.add(hasItem.key); |
{ | ||
"name": "@vercel/routing-utils", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "Vercel routing utilities", | ||
@@ -33,3 +33,3 @@ "main": "./dist/index.js", | ||
}, | ||
"gitHead": "0964be17106419263b3f38d67784dd97b8b0c565" | ||
"gitHead": "1b211f28dfdcb112f1aecb53a2b9f257ecc58420" | ||
} |
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
88619
1855