@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 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 koa. Maintained by Forward Email and Lad.",
4
- "version": "15.2.0",
5
- "author": "Alex Mingoia <talk@alexmingoia.com>",
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.3.0",
39
- "@commitlint/config-conventional": "^20.3.0",
40
- "@koa/bodyparser": "^6.0.0",
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.0.3",
45
- "@types/supertest": "^6.0.3",
46
- "@typescript-eslint/eslint-plugin": "^8.51.0",
47
- "@typescript-eslint/parser": "^8.51.0",
48
- "c8": "^10.1.3",
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": "^9.39.2",
51
- "eslint-plugin-unicorn": "^62.0.0",
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.1",
56
- "lint-staged": "^16.2.7",
57
- "prettier": "^3.7.4",
58
- "rimraf": "^6.1.2",
59
- "supertest": "^7.1.4",
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 --ext .ts,.tsx --fix",
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
  }