@vercel/routing-utils
Advanced tools
Comparing version 1.8.2 to 1.8.3-canary.0
@@ -7,5 +7,5 @@ "use strict"; | ||
*/ | ||
const util_1 = require("util"); | ||
const url_1 = require("url"); | ||
const path_to_regexp_1 = require("path-to-regexp"); | ||
const UN_NAMED_SEGMENT = '__UN_NAMED_SEGMENT__'; | ||
function getCleanUrls(filePaths) { | ||
@@ -142,3 +142,10 @@ const htmlFiles = filePaths | ||
}); | ||
const segments = keys.map(k => k.name).filter(util_1.isString); | ||
const segments = keys | ||
.map(k => k.name) | ||
.map(name => { | ||
if (typeof name !== 'string') { | ||
return UN_NAMED_SEGMENT; | ||
} | ||
return name; | ||
}); | ||
return { src: r.source, segments }; | ||
@@ -156,3 +163,4 @@ } | ||
hash = hash || ''; | ||
if (segments.length > 0) { | ||
const namedSegments = segments.filter(name => name !== UN_NAMED_SEGMENT); | ||
if (namedSegments.length > 0) { | ||
const indexes = {}; | ||
@@ -177,3 +185,3 @@ segments.forEach((name, index) => { | ||
for (const [name, value] of Object.entries(indexes)) { | ||
if (!(name in query)) { | ||
if (!(name in query) && name !== UN_NAMED_SEGMENT) { | ||
query[name] = value; | ||
@@ -180,0 +188,0 @@ } |
{ | ||
"name": "@vercel/routing-utils", | ||
"version": "1.8.2", | ||
"version": "1.8.3-canary.0", | ||
"description": "Vercel routing utilities", | ||
@@ -33,3 +33,3 @@ "main": "./dist/index.js", | ||
}, | ||
"gitHead": "b626f3fe57751dc2c34a0bb8f678bcbbaafae068" | ||
"gitHead": "684c2299842cb52d7f2ba78a13ed12bd046abb7e" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
46465
1109
2