@koa/router 11.0.2 → 12.0.1

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/README.md CHANGED
@@ -54,7 +54,7 @@ npm install @koa/router
54
54
  ## Typescript Support
55
55
 
56
56
  ```sh
57
- npm install @types/koa__router
57
+ npm install --save-dev @types/koa__router
58
58
  ```
59
59
 
60
60
 
package/lib/layer.js CHANGED
@@ -119,7 +119,7 @@ Layer.prototype.url = function (params, options) {
119
119
  }
120
120
  }
121
121
 
122
- const toPath = compile(url, options);
122
+ const toPath = compile(url, { encode: encodeURIComponent, ...options });
123
123
  let replaced;
124
124
 
125
125
  const tokens = parse(url);
package/lib/router.js CHANGED
@@ -10,7 +10,6 @@ const HttpError = require('http-errors');
10
10
  const methods = require('methods');
11
11
  const { pathToRegexp } = require('path-to-regexp');
12
12
  const Layer = require('./layer');
13
-
14
13
  const debug = require('debug')('koa-router');
15
14
 
16
15
  /**
@@ -382,7 +381,8 @@ Router.prototype.routes = Router.prototype.middleware = function () {
382
381
  return next();
383
382
  }
384
383
 
385
- const path = router.opts.routerPath || ctx.routerPath || ctx.path;
384
+ const path =
385
+ router.opts.routerPath || ctx.newRouterPath || ctx.path || ctx.routerPath;
386
386
  const matched = router.match(path, ctx.method);
387
387
  let layerChain;
388
388
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@koa/router",
3
3
  "description": "Router middleware for koa. Maintained by Forward Email and Lad.",
4
- "version": "11.0.2",
4
+ "version": "12.0.1",
5
5
  "author": "Alex Mingoia <talk@alexmingoia.com>",
6
6
  "bugs": {
7
7
  "url": "https://github.com/koajs/router/issues",
@@ -19,27 +19,27 @@
19
19
  "path-to-regexp": "^6.2.1"
20
20
  },
21
21
  "devDependencies": {
22
- "@commitlint/cli": "^17.0.3",
23
- "@commitlint/config-conventional": "^17.0.3",
24
- "@ladjs/env": "^3.0.0",
25
- "ava": "^4.3.0",
22
+ "@commitlint/cli": "^17.7.2",
23
+ "@commitlint/config-conventional": "^17.7.0",
24
+ "@ladjs/env": "^4.0.0",
25
+ "ava": "^5.3.1",
26
26
  "cross-env": "^7.0.3",
27
- "eslint": "^8.19.0",
27
+ "eslint": "8.39.0",
28
28
  "eslint-config-xo-lass": "^2.0.1",
29
29
  "expect.js": "^0.3.1",
30
30
  "fixpack": "^4.0.0",
31
- "husky": "^8.0.1",
32
- "jsdoc-to-markdown": "^7.1.1",
33
- "koa": "^2.13.4",
34
- "lint-staged": "^13.0.3",
35
- "mocha": "^10.0.0",
31
+ "husky": "^8.0.3",
32
+ "jsdoc-to-markdown": "^8.0.0",
33
+ "koa": "^2.14.2",
34
+ "lint-staged": "^14.0.1",
35
+ "mocha": "^10.2.0",
36
36
  "nyc": "^15.1.0",
37
- "remark-cli": "^11.0.0",
37
+ "remark-cli": "11",
38
38
  "remark-preset-github": "^4.0.4",
39
39
  "should": "^13.2.3",
40
- "supertest": "^6.2.4",
40
+ "supertest": "^6.3.3",
41
41
  "wrk": "^1.2.1",
42
- "xo": "^0.50.0"
42
+ "xo": "0.53.1"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">= 12"