@eggjs/router 4.0.0-beta.19 → 4.0.0-beta.21
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/EggRouter.d.ts +98 -102
- package/dist/EggRouter.js +228 -198
- package/dist/Layer.d.ts +111 -115
- package/dist/Layer.js +238 -201
- package/dist/Router.d.ts +489 -491
- package/dist/Router.js +775 -675
- package/dist/index.d.ts +7 -9
- package/dist/index.js +6 -9
- package/dist/types.d.ts +15 -18
- package/dist/types.js +2 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
export { AllowedMethodsOptions, EggRouter, KoaRouter, Layer, LayerOptions, LayerURLOptions, MatchedResult, MiddlewareFunc, MiddlewareFuncWithParamProperty, MiddlewareFuncWithRouter, Next, ParamMiddlewareFunc, RegisterOptions, ResourcesController, Router, RouterMethod, RouterOptions, Router as default };
|
|
1
|
+
import { Router } from './Router.ts';
|
|
2
|
+
export type * from './types.ts';
|
|
3
|
+
export * from './Layer.ts';
|
|
4
|
+
export * from './Router.ts';
|
|
5
|
+
export * from './EggRouter.ts';
|
|
6
|
+
export declare const KoaRouter: typeof Router;
|
|
7
|
+
export default Router;
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { Layer } from "./Layer.js";
|
|
2
1
|
import { Router } from "./Router.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const KoaRouter = Router;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { EggRouter, KoaRouter, Layer, Router, src_default as default };
|
|
2
|
+
export * from "./Layer.js";
|
|
3
|
+
export * from "./Router.js";
|
|
4
|
+
export * from "./EggRouter.js";
|
|
5
|
+
export const KoaRouter = Router;
|
|
6
|
+
export default Router;
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUdyQyxjQUFjLFlBQVksQ0FBQztBQUMzQixjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLGdCQUFnQixDQUFDO0FBRS9CLE1BQU0sQ0FBQyxNQUFNLFNBQVMsR0FBRyxNQUFNLENBQUM7QUFDaEMsZUFBZSxNQUFNLENBQUMifQ==
|
package/dist/types.d.ts
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
type
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
param?: string;
|
|
1
|
+
export type Next = () => Promise<void>;
|
|
2
|
+
export type MiddlewareFunc = (ctx: any, next: Next) => Promise<void> | void;
|
|
3
|
+
export type MiddlewareFuncWithParamProperty = MiddlewareFunc & {
|
|
4
|
+
param?: string;
|
|
6
5
|
};
|
|
7
|
-
type ParamMiddlewareFunc = (param: string, ctx: any, next: Next) => Promise<void> | void;
|
|
8
|
-
type MiddlewareFuncWithRouter<T> = MiddlewareFunc & {
|
|
9
|
-
|
|
6
|
+
export type ParamMiddlewareFunc = (param: string, ctx: any, next: Next) => Promise<void> | void;
|
|
7
|
+
export type MiddlewareFuncWithRouter<T> = MiddlewareFunc & {
|
|
8
|
+
router: T;
|
|
10
9
|
};
|
|
11
|
-
interface ResourcesController {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
export interface ResourcesController {
|
|
11
|
+
index?: MiddlewareFunc;
|
|
12
|
+
new?: MiddlewareFunc;
|
|
13
|
+
create?: MiddlewareFunc;
|
|
14
|
+
show?: MiddlewareFunc;
|
|
15
|
+
edit?: MiddlewareFunc;
|
|
16
|
+
update?: MiddlewareFunc;
|
|
17
|
+
destroy?: MiddlewareFunc;
|
|
19
18
|
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { MiddlewareFunc, MiddlewareFuncWithParamProperty, MiddlewareFuncWithRouter, Next, ParamMiddlewareFunc, ResourcesController };
|
package/dist/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/router",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.21",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22.18.0"
|
|
6
6
|
},
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"tsdown": "^0.15.4",
|
|
40
40
|
"typescript": "^5.9.3",
|
|
41
41
|
"vitest": "4.0.0-beta.16",
|
|
42
|
-
"@eggjs/koa": "3.1.0-beta.
|
|
43
|
-
"@eggjs/
|
|
44
|
-
"@eggjs/
|
|
42
|
+
"@eggjs/koa": "3.1.0-beta.21",
|
|
43
|
+
"@eggjs/supertest": "9.0.0-beta.21",
|
|
44
|
+
"@eggjs/tsconfig": "3.1.0-beta.21"
|
|
45
45
|
},
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"files": [
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"lint": "oxlint --type-aware",
|
|
67
67
|
"typecheck": "tsc --noEmit",
|
|
68
68
|
"test": "vitest run",
|
|
69
|
-
"build": "tsdown",
|
|
69
|
+
"build": "tsdown && rimraf dist && tsc -b --clean && tsc",
|
|
70
70
|
"prebench": "npm run build",
|
|
71
71
|
"bench": "cd bench && make"
|
|
72
72
|
}
|