@koa/router 15.2.0 → 15.3.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/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/package.json +26 -24
package/dist/index.d.mts
CHANGED
|
@@ -261,8 +261,12 @@ declare class RouterImplementation<StateT = koa.DefaultState, ContextT = koa.Def
|
|
|
261
261
|
*/
|
|
262
262
|
use<T = {}, U = {}, B = unknown>(middleware: RouterMiddleware<StateT & T, ContextT & U, B>): Router<StateT, ContextT>;
|
|
263
263
|
use<T = {}, U = {}>(middleware: RouterComposedMiddleware<StateT & T, ContextT & U>): Router<StateT, ContextT>;
|
|
264
|
+
use<T = {}, U = {}, B = unknown>(...middleware: Array<RouterMiddleware<StateT & T, ContextT & U, B>>): Router<StateT, ContextT>;
|
|
265
|
+
use<T = {}, U = {}>(...middleware: Array<RouterComposedMiddleware<StateT & T, ContextT & U>>): Router<StateT, ContextT>;
|
|
264
266
|
use<T = {}, U = {}, B = unknown>(path: string | RegExp | string[], middleware: RouterMiddleware<StateT & T, ContextT & U, B>): Router<StateT, ContextT>;
|
|
265
267
|
use<T = {}, U = {}>(path: string | RegExp | string[], middleware: RouterComposedMiddleware<StateT & T, ContextT & U>): Router<StateT, ContextT>;
|
|
268
|
+
use<T = {}, U = {}, B = unknown>(path: string | RegExp | string[], ...middleware: Array<RouterMiddleware<StateT & T, ContextT & U, B>>): Router<StateT, ContextT>;
|
|
269
|
+
use<T = {}, U = {}>(path: string | RegExp | string[], ...middleware: Array<RouterComposedMiddleware<StateT & T, ContextT & U>>): Router<StateT, ContextT>;
|
|
266
270
|
use<T = {}, U = {}, B = unknown>(path: string | RegExp | string[], m1: RouterMiddleware<StateT & T, ContextT & U, B>, m2: RouterMiddleware<StateT & T, ContextT & U, B> | RouterComposedMiddleware<StateT & T, ContextT & U>, ...middleware: Array<RouterMiddleware<StateT & T, ContextT & U, B> | RouterComposedMiddleware<StateT & T, ContextT & U>>): Router<StateT, ContextT>;
|
|
267
271
|
use<T = {}, U = {}, B = unknown>(m1: RouterMiddleware<StateT & T, ContextT & U, B>, m2: RouterMiddleware<StateT & T, ContextT & U, B> | RouterComposedMiddleware<StateT & T, ContextT & U>, ...middleware: Array<RouterMiddleware<StateT & T, ContextT & U, B> | RouterComposedMiddleware<StateT & T, ContextT & U>>): Router<StateT, ContextT>;
|
|
268
272
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -261,8 +261,12 @@ declare class RouterImplementation<StateT = koa.DefaultState, ContextT = koa.Def
|
|
|
261
261
|
*/
|
|
262
262
|
use<T = {}, U = {}, B = unknown>(middleware: RouterMiddleware<StateT & T, ContextT & U, B>): Router<StateT, ContextT>;
|
|
263
263
|
use<T = {}, U = {}>(middleware: RouterComposedMiddleware<StateT & T, ContextT & U>): Router<StateT, ContextT>;
|
|
264
|
+
use<T = {}, U = {}, B = unknown>(...middleware: Array<RouterMiddleware<StateT & T, ContextT & U, B>>): Router<StateT, ContextT>;
|
|
265
|
+
use<T = {}, U = {}>(...middleware: Array<RouterComposedMiddleware<StateT & T, ContextT & U>>): Router<StateT, ContextT>;
|
|
264
266
|
use<T = {}, U = {}, B = unknown>(path: string | RegExp | string[], middleware: RouterMiddleware<StateT & T, ContextT & U, B>): Router<StateT, ContextT>;
|
|
265
267
|
use<T = {}, U = {}>(path: string | RegExp | string[], middleware: RouterComposedMiddleware<StateT & T, ContextT & U>): Router<StateT, ContextT>;
|
|
268
|
+
use<T = {}, U = {}, B = unknown>(path: string | RegExp | string[], ...middleware: Array<RouterMiddleware<StateT & T, ContextT & U, B>>): Router<StateT, ContextT>;
|
|
269
|
+
use<T = {}, U = {}>(path: string | RegExp | string[], ...middleware: Array<RouterComposedMiddleware<StateT & T, ContextT & U>>): Router<StateT, ContextT>;
|
|
266
270
|
use<T = {}, U = {}, B = unknown>(path: string | RegExp | string[], m1: RouterMiddleware<StateT & T, ContextT & U, B>, m2: RouterMiddleware<StateT & T, ContextT & U, B> | RouterComposedMiddleware<StateT & T, ContextT & U>, ...middleware: Array<RouterMiddleware<StateT & T, ContextT & U, B> | RouterComposedMiddleware<StateT & T, ContextT & U>>): Router<StateT, ContextT>;
|
|
267
271
|
use<T = {}, U = {}, B = unknown>(m1: RouterMiddleware<StateT & T, ContextT & U, B>, m2: RouterMiddleware<StateT & T, ContextT & U, B> | RouterComposedMiddleware<StateT & T, ContextT & U>, ...middleware: Array<RouterMiddleware<StateT & T, ContextT & U, B> | RouterComposedMiddleware<StateT & T, ContextT & U>>): Router<StateT, ContextT>;
|
|
268
272
|
/**
|
package/package.json
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koa/router",
|
|
3
|
-
"description": "Router middleware for
|
|
4
|
-
"version": "15.
|
|
5
|
-
"author": "
|
|
3
|
+
"description": "Router middleware for Koa.",
|
|
4
|
+
"version": "15.3.1",
|
|
5
|
+
"author": "Koa.js",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/koajs/router/issues",
|
|
8
8
|
"email": "niftylettuce@gmail.com"
|
|
9
9
|
},
|
|
10
10
|
"contributors": [
|
|
11
|
-
{
|
|
12
|
-
"name": "Alex Mingoia",
|
|
13
|
-
"email": "talk@alexmingoia.com"
|
|
14
|
-
},
|
|
15
11
|
{
|
|
16
12
|
"name": "@koajs"
|
|
17
13
|
},
|
|
@@ -35,28 +31,30 @@
|
|
|
35
31
|
"path-to-regexp": "^8.3.0"
|
|
36
32
|
},
|
|
37
33
|
"devDependencies": {
|
|
38
|
-
"@commitlint/cli": "^20.
|
|
39
|
-
"@commitlint/config-conventional": "^20.
|
|
40
|
-
"@
|
|
34
|
+
"@commitlint/cli": "^20.4.2",
|
|
35
|
+
"@commitlint/config-conventional": "^20.4.2",
|
|
36
|
+
"@eslint/js": "^10.0.1",
|
|
37
|
+
"@koa/bodyparser": "^6.1.0",
|
|
41
38
|
"@types/debug": "^4.1.12",
|
|
42
39
|
"@types/jsonwebtoken": "^9.0.10",
|
|
43
40
|
"@types/koa": "^3.0.1",
|
|
44
|
-
"@types/node": "^25.
|
|
45
|
-
"@types/supertest": "^
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
47
|
-
"@typescript-eslint/parser": "^8.
|
|
48
|
-
"c8": "^
|
|
41
|
+
"@types/node": "^25.3.2",
|
|
42
|
+
"@types/supertest": "^7.2.0",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
44
|
+
"@typescript-eslint/parser": "^8.56.1",
|
|
45
|
+
"c8": "^11.0.0",
|
|
49
46
|
"chalk": "^5.6.2",
|
|
50
|
-
"eslint": "^
|
|
51
|
-
"eslint-plugin-unicorn": "^
|
|
47
|
+
"eslint": "^10.0.2",
|
|
48
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
52
49
|
"husky": "^9.1.7",
|
|
53
50
|
"joi": "^18.0.2",
|
|
54
51
|
"jsonwebtoken": "^9.0.3",
|
|
55
|
-
"koa": "^3.1.
|
|
56
|
-
"lint-staged": "^16.
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
52
|
+
"koa": "^3.1.2",
|
|
53
|
+
"lint-staged": "^16.3.0",
|
|
54
|
+
"np": "^11.0.2",
|
|
55
|
+
"prettier": "^3.8.1",
|
|
56
|
+
"rimraf": "^6.1.3",
|
|
57
|
+
"supertest": "^7.2.2",
|
|
60
58
|
"ts-node": "^10.9.2",
|
|
61
59
|
"tsup": "^8.5.1",
|
|
62
60
|
"typescript": "^5.9.3"
|
|
@@ -104,7 +102,7 @@
|
|
|
104
102
|
"prepare": "husky install",
|
|
105
103
|
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md,yml,yaml}\"",
|
|
106
104
|
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,md,yml,yaml}\"",
|
|
107
|
-
"lint:ts": "eslint src test --
|
|
105
|
+
"lint:ts": "eslint src test --fix",
|
|
108
106
|
"lint": "npm run lint:ts",
|
|
109
107
|
"test:core": "TS_NODE_PROJECT=tsconfig.ts-node.json node --require ts-node/register --test test/*.test.ts test/**/*.test.ts",
|
|
110
108
|
"test:recipes": "TS_NODE_PROJECT=tsconfig.recipes.json node --require ts-node/register --test recipes/**/*.test.ts",
|
|
@@ -115,6 +113,10 @@
|
|
|
115
113
|
"ts:check:test": "tsc --noEmit --project tsconfig.test.json",
|
|
116
114
|
"prebuild": "rimraf dist",
|
|
117
115
|
"build": "tsup",
|
|
118
|
-
"prepublishOnly": "npm run build"
|
|
116
|
+
"prepublishOnly": "npm run build",
|
|
117
|
+
"release": "np --test-script test:all"
|
|
118
|
+
},
|
|
119
|
+
"resolutions": {
|
|
120
|
+
"c8/yargs": "^18.0.0"
|
|
119
121
|
}
|
|
120
122
|
}
|