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.0 to 1.8.4-canary.1

26

dist/superstatic.js

@@ -168,3 +168,17 @@ "use strict";

});
let destParams = new Set();
if (destination.includes(':') && segments.length > 0) {
const pathnameKeys = [];
const hashKeys = [];
try {
path_to_regexp_1.pathToRegexp(pathname, pathnameKeys);
path_to_regexp_1.pathToRegexp(hash || '', hashKeys);
}
catch (_) {
// this is not fatal so don't error when failing to parse the
// params from the destination
}
destParams = new Set([...pathnameKeys, ...hashKeys]
.map(key => key.name)
.filter(val => typeof val === 'string'));
pathname = safelyCompile(pathname, indexes);

@@ -181,7 +195,9 @@ hash = hash ? safelyCompile(hash, indexes) : null;

// We only add path segments to redirect queries if manually
// specified
if (!isRedirect) {
for (const [name, value] of Object.entries(indexes)) {
if (!(name in query) && name !== UN_NAMED_SEGMENT) {
query[name] = value;
// specified and only automatically add them for rewrites if one
// or more params aren't already used in the destination's path
const paramKeys = Object.keys(indexes);
if (!isRedirect && !paramKeys.some(param => destParams.has(param))) {
for (const param of paramKeys) {
if (!(param in query) && param !== UN_NAMED_SEGMENT) {
query[param] = indexes[param];
}

@@ -188,0 +204,0 @@ }

4

package.json
{
"name": "@vercel/routing-utils",
"version": "1.8.4-canary.0",
"version": "1.8.4-canary.1",
"description": "Vercel routing utilities",

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

},
"gitHead": "d416f70a6e84549be896f0f2450fccd07007803e"
"gitHead": "175f302a7fe7c373ebbee0e82c8e23e7deb44f1b"
}
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