@vercel/routing-utils 1.12.0 → 1.13.1-canary.0

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.
package/dist/schemas.d.ts CHANGED
@@ -150,6 +150,9 @@ export declare const routesSchema: {
150
150
  readonly middleware: {
151
151
  readonly type: "number";
152
152
  };
153
+ readonly middlewarePath: {
154
+ readonly type: "string";
155
+ };
153
156
  readonly has: {
154
157
  readonly description: "An array of requirements that are needed to match";
155
158
  readonly type: "array";
package/dist/schemas.js CHANGED
@@ -151,9 +151,8 @@ exports.routesSchema = {
151
151
  },
152
152
  },
153
153
  },
154
- middleware: {
155
- type: 'number',
156
- },
154
+ middleware: { type: 'number' },
155
+ middlewarePath: { type: 'string' },
157
156
  has: exports.hasSchema,
158
157
  missing: exports.hasSchema,
159
158
  },
@@ -308,7 +308,7 @@ function safelyCompile(value, indexes, attemptDirectCompile) {
308
308
  .replace(/--ESCAPED_PARAM_ASTERISK/g, '*');
309
309
  // the value needs to start with a forward-slash to be compiled
310
310
  // correctly
311
- return path_to_regexp_1.compile(`/${value}`, { validate: false })(indexes).substr(1);
311
+ return path_to_regexp_1.compile(`/${value}`, { validate: false })(indexes).slice(1);
312
312
  }
313
313
  function toSegmentDest(index) {
314
314
  const i = index + 1; // js is base 0, regex is base 1
package/dist/types.d.ts CHANGED
@@ -34,6 +34,14 @@ export declare type Source = {
34
34
  redirect?: Record<string, string>;
35
35
  cookie?: string;
36
36
  };
37
+ /**
38
+ * A middleware key within the `output` key under the build result.
39
+ * Overrides a `middleware` definition.
40
+ */
41
+ middlewarePath?: string;
42
+ /**
43
+ * A middleware index in the `middleware` key under the build result
44
+ */
37
45
  middleware?: number;
38
46
  };
39
47
  export declare type Handler = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/routing-utils",
3
- "version": "1.12.0",
3
+ "version": "1.13.1-canary.0",
4
4
  "description": "Vercel routing utilities",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -30,5 +30,5 @@
30
30
  "optionalDependencies": {
31
31
  "ajv": "^6.0.0"
32
32
  },
33
- "gitHead": "99fa729966c4334aa2d64c592421cc65e1644bdb"
33
+ "gitHead": "c76dfbe8c9e1055113fe7ced8850bca4a64ad232"
34
34
  }