Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vercel/routing-utils

Package Overview
Dependencies
Maintainers
12
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/routing-utils - npm Package Compare versions

Comparing version 1.8.4-canary.2 to 1.8.4-canary.4

19

dist/superstatic.js

@@ -183,8 +183,8 @@ "use strict";

.filter(val => typeof val === 'string'));
pathname = safelyCompile(pathname, indexes);
hash = hash ? safelyCompile(hash, indexes) : null;
pathname = safelyCompile(pathname, indexes, true);
hash = hash ? safelyCompile(hash, indexes, true) : null;
for (const [key, strOrArray] of Object.entries(query)) {
let value = Array.isArray(strOrArray) ? strOrArray[0] : strOrArray;
if (value) {
value = safelyCompile(value, indexes);
value = safelyCompile(value, indexes, true);
}

@@ -216,6 +216,17 @@ query[key] = value;

}
function safelyCompile(value, indexes) {
function safelyCompile(value, indexes, attemptDirectCompile) {
if (!value) {
return value;
}
if (attemptDirectCompile) {
try {
// Attempt compiling normally with path-to-regexp first and fall back
// to safely compiling to handle edge cases if path-to-regexp compile
// fails
return path_to_regexp_1.compile(value, { validate: false })(indexes);
}
catch (e) {
// non-fatal, we continue to safely compile
}
}
for (const key of Object.keys(indexes)) {

@@ -222,0 +233,0 @@ if (value.includes(`:${key}`)) {

{
"name": "@vercel/routing-utils",
"version": "1.8.4-canary.2",
"version": "1.8.4-canary.4",
"description": "Vercel routing utilities",

@@ -33,3 +33,3 @@ "main": "./dist/index.js",

},
"gitHead": "2c239a6ee25ba0e29ccfb6462653a02ede48c82a"
"gitHead": "db8e456603a6747da0c6e1327ec65488896de07f"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc