@vercel/node 5.0.3 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -593,7 +593,8 @@ import { readFileSync } from "fs";
593
593
 
594
594
  // src/utils.ts
595
595
  import { debug, streamToBuffer } from "@vercel/build-utils";
596
- import { pathToRegexp } from "path-to-regexp";
596
+ import { pathToRegexp as pathToRegexpCurrent } from "path-to-regexp";
597
+ import { pathToRegexp as pathToRegexpUpdated } from "path-to-regexp-updated";
597
598
  import { extname } from "path";
598
599
  var WAIT_UNTIL_TIMEOUT = 10;
599
600
  var WAIT_UNTIL_TIMEOUT_MS = 10 * 1e3;
package/dist/index.js CHANGED
@@ -70037,7 +70037,38 @@ function filterDiagnostics(diagnostics, ignore) {
70037
70037
  // src/utils.ts
70038
70038
  var import_build_utils2 = require("@vercel/build-utils");
70039
70039
  var import_path_to_regexp = require("path-to-regexp");
70040
+ var import_path_to_regexp_updated = require("path-to-regexp-updated");
70040
70041
  var import_path2 = require("path");
70042
+ function pathToRegexp(callerId, path, keys, options) {
70043
+ const currentRegExp = (0, import_path_to_regexp.pathToRegexp)(path, keys, options);
70044
+ try {
70045
+ const currentKeys = keys;
70046
+ const newKeys = [];
70047
+ const newRegExp = (0, import_path_to_regexp_updated.pathToRegexp)(path, newKeys, options);
70048
+ const isDiffRegExp = currentRegExp.toString() !== newRegExp.toString();
70049
+ if (process.env.FORCE_PATH_TO_REGEXP_LOG || isDiffRegExp) {
70050
+ const message = JSON.stringify({
70051
+ path,
70052
+ currentRegExp: currentRegExp.toString(),
70053
+ newRegExp: newRegExp.toString()
70054
+ });
70055
+ console.error(`[vc] PATH TO REGEXP PATH DIFF @ #${callerId}: ${message}`);
70056
+ }
70057
+ const isDiffKeys = keys?.toString() !== newKeys?.toString();
70058
+ if (process.env.FORCE_PATH_TO_REGEXP_LOG || isDiffKeys) {
70059
+ const message = JSON.stringify({
70060
+ isDiffKeys,
70061
+ currentKeys,
70062
+ newKeys
70063
+ });
70064
+ console.error(`[vc] PATH TO REGEXP KEYS DIFF @ #${callerId}: ${message}`);
70065
+ }
70066
+ } catch (err) {
70067
+ const error = err;
70068
+ console.error(`[vc] PATH TO REGEXP ERROR @ #${callerId}: ${error.message}`);
70069
+ }
70070
+ return currentRegExp;
70071
+ }
70041
70072
  var WAIT_UNTIL_TIMEOUT_MS = 10 * 1e3;
70042
70073
  function getRegExpFromMatchers(matcherOrMatchers) {
70043
70074
  if (!matcherOrMatchers) {
@@ -70058,9 +70089,9 @@ function getRegExpFromMatcher(matcher, index, allMatchers) {
70058
70089
  `Middleware's \`config.matcher\` values must start with "/". Received: ${matcher}`
70059
70090
  );
70060
70091
  }
70061
- const regExps = [(0, import_path_to_regexp.pathToRegexp)(matcher).source];
70092
+ const regExps = [pathToRegexp("316", matcher).source];
70062
70093
  if (matcher === "/" && !allMatchers.includes("/index")) {
70063
- regExps.push((0, import_path_to_regexp.pathToRegexp)("/index").source);
70094
+ regExps.push(pathToRegexp("491", "/index").source);
70064
70095
  }
70065
70096
  return regExps;
70066
70097
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/node",
3
- "version": "5.0.3",
3
+ "version": "5.0.4",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -29,6 +29,7 @@
29
29
  "etag": "1.8.1",
30
30
  "node-fetch": "2.6.9",
31
31
  "path-to-regexp": "6.2.1",
32
+ "path-to-regexp-updated": "npm:path-to-regexp@6.3.0",
32
33
  "ts-morph": "12.0.0",
33
34
  "ts-node": "10.9.1",
34
35
  "typescript": "4.9.5",