@vercel/node 2.5.6 → 2.5.9

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.
@@ -218,7 +218,8 @@ async function createEdgeRuntime(params) {
218
218
  process: {
219
219
  env: process.env,
220
220
  },
221
- wasmBindings,
221
+ // These are the global bindings for WebAssembly module
222
+ ...wasmBindings,
222
223
  });
223
224
  return context;
224
225
  },
package/dist/index.js CHANGED
@@ -305530,18 +305530,22 @@ function getRegExpFromMatchers(matcherOrMatchers) {
305530
305530
  const matchers = Array.isArray(matcherOrMatchers)
305531
305531
  ? matcherOrMatchers
305532
305532
  : [matcherOrMatchers];
305533
- return matchers.map(getRegExpFromMatcher).join('|');
305533
+ const regExps = matchers.flatMap(getRegExpFromMatcher).join('|');
305534
+ return regExps;
305534
305535
  }
305535
305536
  exports.getRegExpFromMatchers = getRegExpFromMatchers;
305536
- function getRegExpFromMatcher(matcher) {
305537
+ function getRegExpFromMatcher(matcher, index, allMatchers) {
305537
305538
  if (typeof matcher !== 'string') {
305538
305539
  throw new Error("Middleware's `config.matcher` must be a path matcher (string) or an array of path matchers (string[])");
305539
305540
  }
305540
305541
  if (!matcher.startsWith('/')) {
305541
305542
  throw new Error(`Middleware's \`config.matcher\` values must start with "/". Received: ${matcher}`);
305542
305543
  }
305543
- const re = path_to_regexp_1.pathToRegexp(matcher);
305544
- return re.source;
305544
+ const regExps = [path_to_regexp_1.pathToRegexp(matcher).source];
305545
+ if (matcher === '/' && !allMatchers.includes('/index')) {
305546
+ regExps.push(path_to_regexp_1.pathToRegexp('/index').source);
305547
+ }
305548
+ return regExps;
305545
305549
  }
305546
305550
  /**
305547
305551
  * If `zeroConfig`:
package/dist/utils.js CHANGED
@@ -10,18 +10,22 @@ function getRegExpFromMatchers(matcherOrMatchers) {
10
10
  const matchers = Array.isArray(matcherOrMatchers)
11
11
  ? matcherOrMatchers
12
12
  : [matcherOrMatchers];
13
- return matchers.map(getRegExpFromMatcher).join('|');
13
+ const regExps = matchers.flatMap(getRegExpFromMatcher).join('|');
14
+ return regExps;
14
15
  }
15
16
  exports.getRegExpFromMatchers = getRegExpFromMatchers;
16
- function getRegExpFromMatcher(matcher) {
17
+ function getRegExpFromMatcher(matcher, index, allMatchers) {
17
18
  if (typeof matcher !== 'string') {
18
19
  throw new Error("Middleware's `config.matcher` must be a path matcher (string) or an array of path matchers (string[])");
19
20
  }
20
21
  if (!matcher.startsWith('/')) {
21
22
  throw new Error(`Middleware's \`config.matcher\` values must start with "/". Received: ${matcher}`);
22
23
  }
23
- const re = path_to_regexp_1.pathToRegexp(matcher);
24
- return re.source;
24
+ const regExps = [path_to_regexp_1.pathToRegexp(matcher).source];
25
+ if (matcher === '/' && !allMatchers.includes('/index')) {
26
+ regExps.push(path_to_regexp_1.pathToRegexp('/index').source);
27
+ }
28
+ return regExps;
25
29
  }
26
30
  /**
27
31
  * If `zeroConfig`:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/node",
3
- "version": "2.5.6",
3
+ "version": "2.5.9",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@edge-runtime/vm": "1.1.0-beta.23",
33
33
  "@types/node": "*",
34
- "@vercel/build-utils": "5.2.0",
34
+ "@vercel/build-utils": "5.3.1",
35
35
  "@vercel/node-bridge": "3.0.0",
36
36
  "@vercel/static-config": "2.0.3",
37
37
  "edge-runtime": "1.1.0-beta.23",
@@ -61,5 +61,5 @@
61
61
  "source-map-support": "0.5.12",
62
62
  "test-listen": "1.1.0"
63
63
  },
64
- "gitHead": "32afd67d29d46f67027091ab9695d8ff330355b5"
64
+ "gitHead": "ad0ed6d8520e717fab3e4e22df21e879d3660be7"
65
65
  }