@tsed/platform-koa 6.87.2 → 6.90.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/lib/{components → cjs/components}/PlatformKoa.d.ts +15 -8
- package/lib/cjs/components/PlatformKoa.js +89 -0
- package/lib/cjs/components/PlatformKoa.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/caseSensitive.d.ts +0 -0
- package/lib/{decorators → cjs/decorators}/caseSensitive.js +1 -1
- package/lib/cjs/decorators/caseSensitive.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/ctx.d.ts +0 -0
- package/lib/{decorators → cjs/decorators}/ctx.js +1 -1
- package/lib/cjs/decorators/ctx.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/index.d.ts +0 -0
- package/lib/cjs/decorators/index.js +9 -0
- package/lib/cjs/decorators/index.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/routerSettings.d.ts +0 -0
- package/lib/{decorators → cjs/decorators}/routerSettings.js +1 -1
- package/lib/cjs/decorators/routerSettings.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/state.d.ts +0 -0
- package/lib/{decorators → cjs/decorators}/state.js +0 -0
- package/lib/cjs/decorators/state.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/strict.d.ts +0 -0
- package/lib/{decorators → cjs/decorators}/strict.js +1 -1
- package/lib/cjs/decorators/strict.js.map +1 -0
- package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
- package/lib/cjs/index.js +16 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/PlatformKoaSettings.d.ts +0 -0
- package/lib/{interfaces → cjs/interfaces}/PlatformKoaSettings.js +0 -0
- package/lib/cjs/interfaces/PlatformKoaSettings.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/index.d.ts +0 -0
- package/lib/{interfaces → cjs/interfaces}/index.js +1 -1
- package/lib/cjs/interfaces/index.js.map +1 -0
- package/lib/{middlewares → cjs/middlewares}/resourceNotFoundMiddleware.d.ts +0 -0
- package/lib/{middlewares → cjs/middlewares}/resourceNotFoundMiddleware.js +0 -0
- package/lib/cjs/middlewares/resourceNotFoundMiddleware.js.map +1 -0
- package/lib/{middlewares → cjs/middlewares}/staticsMiddleware.d.ts +0 -0
- package/lib/{middlewares → cjs/middlewares}/staticsMiddleware.js +2 -2
- package/lib/cjs/middlewares/staticsMiddleware.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformKoaApplication.d.ts +0 -0
- package/lib/{services → cjs/services}/PlatformKoaApplication.js +5 -4
- package/lib/cjs/services/PlatformKoaApplication.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformKoaHandler.d.ts +0 -0
- package/lib/{services → cjs/services}/PlatformKoaHandler.js +0 -0
- package/lib/cjs/services/PlatformKoaHandler.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformKoaRequest.d.ts +1 -1
- package/lib/cjs/services/PlatformKoaRequest.js +44 -0
- package/lib/cjs/services/PlatformKoaRequest.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformKoaResponse.d.ts +2 -2
- package/lib/{services → cjs/services}/PlatformKoaResponse.js +8 -8
- package/lib/cjs/services/PlatformKoaResponse.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformKoaRouter.d.ts +0 -0
- package/lib/{services → cjs/services}/PlatformKoaRouter.js +7 -7
- package/lib/cjs/services/PlatformKoaRouter.js.map +1 -0
- package/lib/{services → cjs/services}/index.d.ts +0 -0
- package/lib/cjs/services/index.js +9 -0
- package/lib/cjs/services/index.js.map +1 -0
- package/lib/{utils → cjs/utils}/multer.d.ts +0 -0
- package/lib/{utils → cjs/utils}/multer.js +1 -1
- package/lib/cjs/utils/multer.js.map +1 -0
- package/lib/esm/components/PlatformKoa.js +85 -0
- package/lib/esm/components/PlatformKoa.js.map +1 -0
- package/lib/esm/decorators/caseSensitive.js +26 -0
- package/lib/esm/decorators/caseSensitive.js.map +1 -0
- package/lib/esm/decorators/ctx.js +27 -0
- package/lib/esm/decorators/ctx.js.map +1 -0
- package/lib/esm/decorators/index.js +6 -0
- package/lib/esm/decorators/index.js.map +1 -0
- package/lib/esm/decorators/routerSettings.js +27 -0
- package/lib/esm/decorators/routerSettings.js.map +1 -0
- package/lib/esm/decorators/state.js +5 -0
- package/lib/esm/decorators/state.js.map +1 -0
- package/lib/esm/decorators/strict.js +27 -0
- package/lib/esm/decorators/strict.js.map +1 -0
- package/lib/esm/index.js +13 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/interfaces/PlatformKoaSettings.js +2 -0
- package/lib/esm/interfaces/PlatformKoaSettings.js.map +1 -0
- package/lib/esm/interfaces/index.js +2 -0
- package/lib/esm/interfaces/index.js.map +1 -0
- package/lib/esm/middlewares/resourceNotFoundMiddleware.js +16 -0
- package/lib/esm/middlewares/resourceNotFoundMiddleware.js.map +1 -0
- package/lib/esm/middlewares/staticsMiddleware.js +30 -0
- package/lib/esm/middlewares/staticsMiddleware.js.map +1 -0
- package/lib/esm/services/PlatformKoaApplication.js +29 -0
- package/lib/esm/services/PlatformKoaApplication.js.map +1 -0
- package/lib/esm/services/PlatformKoaHandler.js +56 -0
- package/lib/esm/services/PlatformKoaHandler.js.map +1 -0
- package/lib/esm/services/PlatformKoaRequest.js +40 -0
- package/lib/esm/services/PlatformKoaRequest.js.map +1 -0
- package/lib/esm/services/PlatformKoaResponse.js +101 -0
- package/lib/esm/services/PlatformKoaResponse.js.map +1 -0
- package/lib/esm/services/PlatformKoaRouter.js +42 -0
- package/lib/esm/services/PlatformKoaRouter.js.map +1 -0
- package/lib/esm/services/index.js +6 -0
- package/lib/esm/services/index.js.map +1 -0
- package/lib/esm/utils/multer.js +51 -0
- package/lib/esm/utils/multer.js.map +1 -0
- package/lib/types/components/PlatformKoa.d.ts +45 -0
- package/lib/types/decorators/caseSensitive.d.ts +22 -0
- package/lib/types/decorators/ctx.d.ts +19 -0
- package/lib/types/decorators/index.d.ts +5 -0
- package/lib/types/decorators/routerSettings.d.ts +24 -0
- package/lib/types/decorators/state.d.ts +38 -0
- package/lib/types/decorators/strict.d.ts +23 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/interfaces/PlatformKoaSettings.d.ts +8 -0
- package/lib/types/interfaces/index.d.ts +15 -0
- package/lib/types/middlewares/resourceNotFoundMiddleware.d.ts +6 -0
- package/lib/types/middlewares/staticsMiddleware.d.ts +6 -0
- package/lib/types/services/PlatformKoaApplication.d.ts +22 -0
- package/lib/types/services/PlatformKoaHandler.d.ts +10 -0
- package/lib/types/services/PlatformKoaRequest.d.ts +34 -0
- package/lib/types/services/PlatformKoaResponse.d.ts +57 -0
- package/lib/types/services/PlatformKoaRouter.d.ts +22 -0
- package/lib/types/services/index.d.ts +5 -0
- package/lib/types/utils/multer.d.ts +4 -0
- package/package.json +26 -18
- package/tsconfig.compile.esm.json +23 -0
- package/lib/components/PlatformKoa.js +0 -78
- package/lib/components/PlatformKoa.js.map +0 -1
- package/lib/decorators/caseSensitive.js.map +0 -1
- package/lib/decorators/ctx.js.map +0 -1
- package/lib/decorators/index.js +0 -9
- package/lib/decorators/index.js.map +0 -1
- package/lib/decorators/routerSettings.js.map +0 -1
- package/lib/decorators/state.js.map +0 -1
- package/lib/decorators/strict.js.map +0 -1
- package/lib/index.js +0 -16
- package/lib/index.js.map +0 -1
- package/lib/interfaces/PlatformKoaSettings.js.map +0 -1
- package/lib/interfaces/index.js.map +0 -1
- package/lib/middlewares/resourceNotFoundMiddleware.js.map +0 -1
- package/lib/middlewares/staticsMiddleware.js.map +0 -1
- package/lib/services/PlatformKoaApplication.js.map +0 -1
- package/lib/services/PlatformKoaHandler.js.map +0 -1
- package/lib/services/PlatformKoaRequest.js +0 -44
- package/lib/services/PlatformKoaRequest.js.map +0 -1
- package/lib/services/PlatformKoaResponse.js.map +0 -1
- package/lib/services/PlatformKoaRouter.js.map +0 -1
- package/lib/services/index.js +0 -9
- package/lib/services/index.js.map +0 -1
- package/lib/utils/multer.js.map +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
+
import KoaRouter from "@koa/router";
|
|
3
|
+
import { PLATFORM_ROUTER_OPTIONS, PlatformHandler, PlatformRouter } from "@tsed/common";
|
|
4
|
+
import { Configuration, Inject } from "@tsed/di";
|
|
5
|
+
import { staticsMiddleware } from "../middlewares/staticsMiddleware";
|
|
6
|
+
import { getMulter } from "../utils/multer";
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
KoaRouter.prototype.$$match = KoaRouter.prototype.match;
|
|
9
|
+
KoaRouter.prototype.match = function match(...args) {
|
|
10
|
+
const matched = this.$$match(...args);
|
|
11
|
+
if (matched) {
|
|
12
|
+
if (matched.path.length) {
|
|
13
|
+
matched.route = true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return matched;
|
|
17
|
+
};
|
|
18
|
+
let PlatformKoaRouter = class PlatformKoaRouter extends PlatformRouter {
|
|
19
|
+
constructor(platform, configuration, routerOptions) {
|
|
20
|
+
var _a;
|
|
21
|
+
super(platform);
|
|
22
|
+
const options = Object.assign({}, ((_a = configuration.koa) === null || _a === void 0 ? void 0 : _a.router) || {}, routerOptions);
|
|
23
|
+
this.rawRouter = new KoaRouter(options);
|
|
24
|
+
}
|
|
25
|
+
callback() {
|
|
26
|
+
return [this.getRouter().routes(), this.getRouter().allowedMethods()];
|
|
27
|
+
}
|
|
28
|
+
multer(options) {
|
|
29
|
+
return getMulter(options);
|
|
30
|
+
}
|
|
31
|
+
statics(path, options) {
|
|
32
|
+
this.rawRouter.use(path, staticsMiddleware(options));
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
PlatformKoaRouter = __decorate([
|
|
37
|
+
__param(1, Configuration()),
|
|
38
|
+
__param(2, Inject(PLATFORM_ROUTER_OPTIONS)),
|
|
39
|
+
__metadata("design:paramtypes", [PlatformHandler, Object, Object])
|
|
40
|
+
], PlatformKoaRouter);
|
|
41
|
+
export { PlatformKoaRouter };
|
|
42
|
+
//# sourceMappingURL=PlatformKoaRouter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformKoaRouter.js","sourceRoot":"","sources":["../../../src/services/PlatformKoaRouter.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,OAAO,EACL,uBAAuB,EACvB,eAAe,EAGf,cAAc,EAEf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,aAAa,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAY1C,aAAa;AACb,SAAS,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC;AACxD,SAAS,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,KAAK,CAAC,GAAG,IAAW;IACvD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IACtC,IAAI,OAAO,EAAE;QACX,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE;YACvB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;SACtB;KACF;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,cAAyB;IAC9D,YACE,QAAyB,EACR,aAA4B,EACZ,aAAkB;;QAEnD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEhB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAA,MAAA,aAAa,CAAC,GAAG,0CAAE,MAAM,KAAI,EAAE,EAAE,aAAa,CAAC,CAAC;QAClF,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,OAAO,CAAQ,CAAC;IACjD,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,CAAC,OAA+B;QACpC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,OAA+B;QACnD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAQ,CAAC,CAAC;QAE5D,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAzBY,iBAAiB;IAGzB,WAAA,aAAa,EAAE,CAAA;IACf,WAAA,MAAM,CAAC,uBAAuB,CAAC,CAAA;qCAFtB,eAAe;GAFhB,iBAAiB,CAyB7B;SAzBY,iBAAiB","sourcesContent":["import KoaRouter from \"@koa/router\";\nimport {RouterOptions as KoaRouterOptions} from \"@koa/router\";\n\nimport {\n PLATFORM_ROUTER_OPTIONS,\n PlatformHandler,\n PlatformMulter,\n PlatformMulterSettings,\n PlatformRouter,\n PlatformStaticsOptions\n} from \"@tsed/common\";\nimport {Configuration, Inject} from \"@tsed/di\";\nimport send from \"koa-send\";\nimport {staticsMiddleware} from \"../middlewares/staticsMiddleware\";\nimport {getMulter} from \"../utils/multer\";\n\ndeclare global {\n namespace TsED {\n export interface Router extends KoaRouter {}\n\n export interface RouterOptions extends KoaRouterOptions {}\n\n export interface StaticsOptions extends send.SendOptions {}\n }\n}\n\n// @ts-ignore\nKoaRouter.prototype.$$match = KoaRouter.prototype.match;\nKoaRouter.prototype.match = function match(...args: any[]) {\n const matched = this.$$match(...args);\n if (matched) {\n if (matched.path.length) {\n matched.route = true;\n }\n }\n\n return matched;\n};\n\nexport class PlatformKoaRouter extends PlatformRouter<KoaRouter> {\n constructor(\n platform: PlatformHandler,\n @Configuration() configuration: Configuration,\n @Inject(PLATFORM_ROUTER_OPTIONS) routerOptions: any\n ) {\n super(platform);\n\n const options = Object.assign({}, configuration.koa?.router || {}, routerOptions);\n this.rawRouter = new KoaRouter(options) as any;\n }\n\n callback() {\n return [this.getRouter().routes(), this.getRouter().allowedMethods()];\n }\n\n multer(options: PlatformMulterSettings): PlatformMulter {\n return getMulter(options);\n }\n\n statics(path: string, options: PlatformStaticsOptions) {\n this.rawRouter.use(path, staticsMiddleware(options) as any);\n\n return this;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from \"./PlatformKoaApplication\";\nexport * from \"./PlatformKoaHandler\";\nexport * from \"./PlatformKoaRouter\";\nexport * from \"./PlatformKoaRequest\";\nexport * from \"./PlatformKoaResponse\";\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { promisify } from "util";
|
|
2
|
+
/**
|
|
3
|
+
* @ignore
|
|
4
|
+
*/
|
|
5
|
+
function createRawMiddleware(middleware) {
|
|
6
|
+
return async (request) => {
|
|
7
|
+
const ctx = request.ctx;
|
|
8
|
+
await middleware(ctx.req, ctx.res);
|
|
9
|
+
const forwardKey = (key) => {
|
|
10
|
+
if (ctx.req[key]) {
|
|
11
|
+
ctx.request[key] = ctx.req[key];
|
|
12
|
+
ctx[key] = ctx.req[key];
|
|
13
|
+
delete ctx.req[key];
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
if ("request" in ctx) {
|
|
17
|
+
if (ctx.req.body) {
|
|
18
|
+
ctx.request.body = ctx.req.body;
|
|
19
|
+
delete ctx.req.body;
|
|
20
|
+
}
|
|
21
|
+
forwardKey("file");
|
|
22
|
+
forwardKey("files");
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @ignore
|
|
28
|
+
*/
|
|
29
|
+
function makePromise(multer, name) {
|
|
30
|
+
// istanbul ignore next
|
|
31
|
+
if (!multer[name])
|
|
32
|
+
return;
|
|
33
|
+
const fn = multer[name];
|
|
34
|
+
multer[name] = function apply(...args) {
|
|
35
|
+
const middleware = Reflect.apply(fn, this, args);
|
|
36
|
+
return createRawMiddleware(promisify(middleware));
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @ignore
|
|
41
|
+
*/
|
|
42
|
+
export function getMulter(options) {
|
|
43
|
+
const m = require("multer")(options);
|
|
44
|
+
makePromise(m, "any");
|
|
45
|
+
makePromise(m, "array");
|
|
46
|
+
makePromise(m, "fields");
|
|
47
|
+
makePromise(m, "none");
|
|
48
|
+
makePromise(m, "single");
|
|
49
|
+
return m;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=multer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multer.js","sourceRoot":"","sources":["../../../src/utils/multer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,MAAM,CAAC;AAE/B;;GAEG;AACH,SAAS,mBAAmB,CAAC,UAAe;IAC1C,OAAO,KAAK,EAAE,OAAoB,EAAE,EAAE;QACpC,MAAM,GAAG,GAAQ,OAAO,CAAC,GAAG,CAAC;QAE7B,MAAM,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QAEnC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE;YACjC,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBAChB,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBAChC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACxB,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACrB;QACH,CAAC,CAAC;QAEF,IAAI,SAAS,IAAI,GAAG,EAAE;YACpB,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE;gBAChB,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;gBAChC,OAAO,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;aACrB;YAED,UAAU,CAAC,MAAM,CAAC,CAAC;YACnB,UAAU,CAAC,OAAO,CAAC,CAAC;SACrB;IACH,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,MAAW,EAAE,IAAY;IAC5C,uBAAuB;IACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO;IAE1B,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAExB,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,KAAK,CAAC,GAAG,IAAW;QAC1C,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAEjD,OAAO,mBAAmB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,OAAY;IACpC,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;IAErC,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACtB,WAAW,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACxB,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACzB,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACvB,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAEzB,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["import Koa from \"koa\";\nimport {promisify} from \"util\";\n\n/**\n * @ignore\n */\nfunction createRawMiddleware(middleware: any) {\n return async (request: Koa.Request) => {\n const ctx: any = request.ctx;\n\n await middleware(ctx.req, ctx.res);\n\n const forwardKey = (key: string) => {\n if (ctx.req[key]) {\n ctx.request[key] = ctx.req[key];\n ctx[key] = ctx.req[key];\n delete ctx.req[key];\n }\n };\n\n if (\"request\" in ctx) {\n if (ctx.req.body) {\n ctx.request.body = ctx.req.body;\n delete ctx.req.body;\n }\n\n forwardKey(\"file\");\n forwardKey(\"files\");\n }\n };\n}\n\n/**\n * @ignore\n */\nfunction makePromise(multer: any, name: string) {\n // istanbul ignore next\n if (!multer[name]) return;\n\n const fn = multer[name];\n\n multer[name] = function apply(...args: any[]) {\n const middleware = Reflect.apply(fn, this, args);\n\n return createRawMiddleware(promisify(middleware));\n };\n}\n\n/**\n * @ignore\n */\nexport function getMulter(options: any) {\n const m = require(\"multer\")(options);\n\n makePromise(m, \"any\");\n makePromise(m, \"array\");\n makePromise(m, \"fields\");\n makePromise(m, \"none\");\n makePromise(m, \"single\");\n\n return m;\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/// <reference types="koa__router" />
|
|
2
|
+
import KoaRouter from "@koa/router";
|
|
3
|
+
import { PlatformAdapter, PlatformApplication, PlatformBuilder, PlatformHandler, PlatformRequest, PlatformResponse, PlatformRouter } from "@tsed/common";
|
|
4
|
+
import { Type } from "@tsed/core";
|
|
5
|
+
import Koa from "koa";
|
|
6
|
+
import { PlatformKoaApplication, PlatformKoaHandler, PlatformKoaRequest, PlatformKoaResponse, PlatformKoaRouter } from "../services";
|
|
7
|
+
/**
|
|
8
|
+
* @platform
|
|
9
|
+
* @koa
|
|
10
|
+
*/
|
|
11
|
+
export declare class PlatformKoa implements PlatformAdapter<Koa, KoaRouter> {
|
|
12
|
+
private platform;
|
|
13
|
+
readonly providers: ({
|
|
14
|
+
provide: typeof PlatformResponse;
|
|
15
|
+
useClass: typeof PlatformKoaResponse;
|
|
16
|
+
} | {
|
|
17
|
+
provide: typeof PlatformRequest;
|
|
18
|
+
useClass: typeof PlatformKoaRequest;
|
|
19
|
+
} | {
|
|
20
|
+
provide: typeof PlatformHandler;
|
|
21
|
+
useClass: typeof PlatformKoaHandler;
|
|
22
|
+
} | {
|
|
23
|
+
provide: typeof PlatformRouter;
|
|
24
|
+
useClass: typeof PlatformKoaRouter;
|
|
25
|
+
} | {
|
|
26
|
+
provide: typeof PlatformApplication;
|
|
27
|
+
useClass: typeof PlatformKoaApplication;
|
|
28
|
+
})[];
|
|
29
|
+
constructor(platform: PlatformBuilder<Koa, KoaRouter>);
|
|
30
|
+
/**
|
|
31
|
+
* Create new serverless application. In this mode, the component scan are disabled.
|
|
32
|
+
* @param module
|
|
33
|
+
* @param settings
|
|
34
|
+
*/
|
|
35
|
+
static create(module: Type<any>, settings?: Partial<TsED.Configuration>): PlatformBuilder<Koa<Koa.DefaultState, Koa.DefaultContext>, KoaRouter<any, {}>>;
|
|
36
|
+
/**
|
|
37
|
+
* Bootstrap a server application
|
|
38
|
+
* @param module
|
|
39
|
+
* @param settings
|
|
40
|
+
*/
|
|
41
|
+
static bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<PlatformBuilder<Koa<Koa.DefaultState, Koa.DefaultContext>, KoaRouter<any, {}>>>;
|
|
42
|
+
onInit(): void;
|
|
43
|
+
useRouter(): this;
|
|
44
|
+
useContext(): this;
|
|
45
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Specify the behavior of the router controller.
|
|
3
|
+
*
|
|
4
|
+
* ```typescript
|
|
5
|
+
* @Controller("/")
|
|
6
|
+
* @CaseSensitive(true)
|
|
7
|
+
* class MyCtrl {
|
|
8
|
+
*
|
|
9
|
+
* }
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Property | Description | Default
|
|
13
|
+
* ---|---|---
|
|
14
|
+
* CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
|
|
15
|
+
* Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
|
|
16
|
+
*
|
|
17
|
+
* @returns {Function}
|
|
18
|
+
* @decorator
|
|
19
|
+
* @koa
|
|
20
|
+
* @param sensitive
|
|
21
|
+
*/
|
|
22
|
+
export declare function CaseSensitive(sensitive: boolean): Function;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Context } from "koa";
|
|
2
|
+
/**
|
|
3
|
+
* Return the original Koa context.
|
|
4
|
+
* @decorator
|
|
5
|
+
* @operation
|
|
6
|
+
* @input
|
|
7
|
+
* @koa
|
|
8
|
+
*/
|
|
9
|
+
export declare function KoaCtx(): ParameterDecorator;
|
|
10
|
+
/**
|
|
11
|
+
* Return the original Koa context.
|
|
12
|
+
* @decorator
|
|
13
|
+
* @operation
|
|
14
|
+
* @input
|
|
15
|
+
* @koa
|
|
16
|
+
*/
|
|
17
|
+
export declare function Ctx(): ParameterDecorator;
|
|
18
|
+
export declare type Ctx = Context;
|
|
19
|
+
export declare type KoaCtx = Context;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="koa__router" />
|
|
2
|
+
import { RouterOptions } from "@koa/router";
|
|
3
|
+
/**
|
|
4
|
+
* Specify the behavior of the router controller.
|
|
5
|
+
*
|
|
6
|
+
* ```typescript
|
|
7
|
+
* @Controller("/")
|
|
8
|
+
* @RouterSettings({sensitive: true})
|
|
9
|
+
* class MyCtrl {
|
|
10
|
+
*
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Property | Description | Default
|
|
15
|
+
* ---|---|---
|
|
16
|
+
* sensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
|
|
17
|
+
* strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
|
|
18
|
+
*
|
|
19
|
+
* @returns {(target:any)=>void}
|
|
20
|
+
* @decorator
|
|
21
|
+
* @param routerOptions
|
|
22
|
+
* @koa
|
|
23
|
+
*/
|
|
24
|
+
export declare function RouterSettings(routerOptions: RouterOptions): Function;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State return the value from koa.ctx.state object.
|
|
3
|
+
*
|
|
4
|
+
* #### Example
|
|
5
|
+
*
|
|
6
|
+
* ```typescript
|
|
7
|
+
* * @Middleware()
|
|
8
|
+
* class StateMiddleware {
|
|
9
|
+
* use(@State() state: any) {
|
|
10
|
+
* // set some on locals
|
|
11
|
+
* state.user = "user"
|
|
12
|
+
* }
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* @Controller('/')
|
|
16
|
+
* @UseBefore(StateMiddleware)
|
|
17
|
+
* class MyCtrl {
|
|
18
|
+
* @Get('/')
|
|
19
|
+
* @View('home.ejs') // will use locals and returned data to render the page
|
|
20
|
+
* get(@State('user') user: any) {
|
|
21
|
+
* console.log('user', user);
|
|
22
|
+
*
|
|
23
|
+
* return {
|
|
24
|
+
* description: 'Hello world'
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @param expression The path of the property to get.
|
|
31
|
+
* @decorator
|
|
32
|
+
* @operation
|
|
33
|
+
* @input
|
|
34
|
+
* @response
|
|
35
|
+
* @koa
|
|
36
|
+
*/
|
|
37
|
+
export declare function State(expression: string): ParameterDecorator;
|
|
38
|
+
export declare function State(): ParameterDecorator;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Specify the behavior of the router controller.
|
|
3
|
+
*
|
|
4
|
+
* ```typescript
|
|
5
|
+
* @Controller("/")
|
|
6
|
+
* @Strict(true)
|
|
7
|
+
* class MyCtrl {
|
|
8
|
+
*
|
|
9
|
+
* }
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Property | Description | Default
|
|
13
|
+
* ---|---|---
|
|
14
|
+
* CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
|
|
15
|
+
* MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
|
|
16
|
+
* Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
|
|
17
|
+
*
|
|
18
|
+
* @param strict
|
|
19
|
+
* @returns {Function}
|
|
20
|
+
* @decorator
|
|
21
|
+
* @koa
|
|
22
|
+
*/
|
|
23
|
+
export declare function Strict(strict: boolean): Function;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="koa__router" />
|
|
2
|
+
import { RouterOptions } from "@koa/router";
|
|
3
|
+
export interface PlatformKoaSettings {
|
|
4
|
+
/**
|
|
5
|
+
* Global configuration for the Express.Router. See express [documentation](http://expressjs.com/en/api.html#express.router).
|
|
6
|
+
*/
|
|
7
|
+
router: RouterOptions;
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Koa from "koa";
|
|
2
|
+
import { PlatformKoaSettings } from "./PlatformKoaSettings";
|
|
3
|
+
export * from "./PlatformKoaSettings";
|
|
4
|
+
declare global {
|
|
5
|
+
namespace TsED {
|
|
6
|
+
interface Configuration {
|
|
7
|
+
/**
|
|
8
|
+
* Configuration related to Koa platform application.
|
|
9
|
+
*/
|
|
10
|
+
koa: PlatformKoaSettings;
|
|
11
|
+
}
|
|
12
|
+
interface NextFunction extends Koa.Next {
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="koa__router" />
|
|
2
|
+
import KoaRouter from "@koa/router";
|
|
3
|
+
import { Configuration, PlatformApplication, PlatformHandler } from "@tsed/common";
|
|
4
|
+
import Koa from "koa";
|
|
5
|
+
import { PlatformKoaRouter } from "./PlatformKoaRouter";
|
|
6
|
+
declare global {
|
|
7
|
+
namespace TsED {
|
|
8
|
+
interface Application extends Koa {
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @platform
|
|
14
|
+
* @express
|
|
15
|
+
*/
|
|
16
|
+
export declare class PlatformKoaApplication extends PlatformKoaRouter implements PlatformApplication<Koa, KoaRouter> {
|
|
17
|
+
app: Koa;
|
|
18
|
+
rawApp: Koa;
|
|
19
|
+
constructor(platformHandler: PlatformHandler, configuration: Configuration);
|
|
20
|
+
getApp(): Koa;
|
|
21
|
+
callback(): any;
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HandlerMetadata, OnRequestOptions, PlatformContext, PlatformHandler } from "@tsed/common";
|
|
2
|
+
import "./PlatformKoaRequest";
|
|
3
|
+
export declare class PlatformKoaHandler extends PlatformHandler {
|
|
4
|
+
flush(data: any, ctx: PlatformContext): Promise<void>;
|
|
5
|
+
protected createRawHandler(metadata: HandlerMetadata): any;
|
|
6
|
+
protected onRequest(requestOptions: OnRequestOptions): Promise<any>;
|
|
7
|
+
protected onError(error: unknown, requestOptions: OnRequestOptions): any;
|
|
8
|
+
protected onCtxRequest(requestOptions: OnRequestOptions): Promise<any>;
|
|
9
|
+
protected throwError(error: any, $ctx: PlatformContext): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import "@koa/router";
|
|
3
|
+
import { IncomingEvent, PlatformContext, PlatformRequest } from "@tsed/common";
|
|
4
|
+
import { IncomingMessage } from "http";
|
|
5
|
+
import Koa from "koa";
|
|
6
|
+
declare module "koa" {
|
|
7
|
+
interface Request {
|
|
8
|
+
id: string;
|
|
9
|
+
$ctx: PlatformContext;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
namespace TsED {
|
|
14
|
+
interface Request extends Koa.Request {
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @platform
|
|
20
|
+
* @koa
|
|
21
|
+
*/
|
|
22
|
+
export declare class PlatformKoaRequest extends PlatformRequest<Koa.Request> {
|
|
23
|
+
#private;
|
|
24
|
+
constructor(event: IncomingEvent, $ctx: PlatformContext);
|
|
25
|
+
get protocol(): string;
|
|
26
|
+
get host(): string;
|
|
27
|
+
get secure(): boolean;
|
|
28
|
+
get cookies(): {
|
|
29
|
+
[p: string]: any;
|
|
30
|
+
};
|
|
31
|
+
get session(): any;
|
|
32
|
+
getReq(): IncomingMessage;
|
|
33
|
+
destroy(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IncomingEvent, PlatformContext, PlatformResponse } from "@tsed/common";
|
|
3
|
+
import { ServerResponse } from "http";
|
|
4
|
+
import Koa from "koa";
|
|
5
|
+
declare global {
|
|
6
|
+
namespace TsED {
|
|
7
|
+
interface Response extends Koa.Response {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @platform
|
|
13
|
+
* @koa
|
|
14
|
+
*/
|
|
15
|
+
export declare class PlatformKoaResponse extends PlatformResponse<Koa.Response> {
|
|
16
|
+
#private;
|
|
17
|
+
constructor(event: IncomingEvent, $ctx: PlatformContext);
|
|
18
|
+
get statusCode(): number;
|
|
19
|
+
get locals(): Koa.DefaultState;
|
|
20
|
+
/**
|
|
21
|
+
* Return the Node.js response object
|
|
22
|
+
*/
|
|
23
|
+
getRes(): ServerResponse;
|
|
24
|
+
hasStatus(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Sets the HTTP status for the response.
|
|
27
|
+
*
|
|
28
|
+
* @param status
|
|
29
|
+
*/
|
|
30
|
+
status(status: number): this;
|
|
31
|
+
/**
|
|
32
|
+
* Set `Content-Type` response header with `type` through `mime.lookup()`
|
|
33
|
+
* when it does not contain "/", or set the Content-Type to `type` otherwise.
|
|
34
|
+
*
|
|
35
|
+
* Examples:
|
|
36
|
+
*
|
|
37
|
+
* res.type('.html');
|
|
38
|
+
* res.type('html');
|
|
39
|
+
* res.type('json');
|
|
40
|
+
* res.type('application/json');
|
|
41
|
+
* res.type('png');
|
|
42
|
+
*/
|
|
43
|
+
contentType(contentType: string): this;
|
|
44
|
+
getHeaders(): any;
|
|
45
|
+
/**
|
|
46
|
+
* Send any data to your consumer.
|
|
47
|
+
*
|
|
48
|
+
* This method accept a ReadableStream, a plain object, boolean, string, number, null and undefined data.
|
|
49
|
+
* It choose the better way to send the data.
|
|
50
|
+
*
|
|
51
|
+
* @param data
|
|
52
|
+
*/
|
|
53
|
+
body(data: any): this;
|
|
54
|
+
getBody(): any;
|
|
55
|
+
redirect(status: number, url: string): this;
|
|
56
|
+
location(location: string): this;
|
|
57
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="koa__router" />
|
|
2
|
+
import KoaRouter from "@koa/router";
|
|
3
|
+
import { RouterOptions as KoaRouterOptions } from "@koa/router";
|
|
4
|
+
import { PlatformHandler, PlatformMulter, PlatformMulterSettings, PlatformRouter, PlatformStaticsOptions } from "@tsed/common";
|
|
5
|
+
import { Configuration } from "@tsed/di";
|
|
6
|
+
import send from "koa-send";
|
|
7
|
+
declare global {
|
|
8
|
+
namespace TsED {
|
|
9
|
+
interface Router extends KoaRouter {
|
|
10
|
+
}
|
|
11
|
+
interface RouterOptions extends KoaRouterOptions {
|
|
12
|
+
}
|
|
13
|
+
interface StaticsOptions extends send.SendOptions {
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export declare class PlatformKoaRouter extends PlatformRouter<KoaRouter> {
|
|
18
|
+
constructor(platform: PlatformHandler, configuration: Configuration, routerOptions: any);
|
|
19
|
+
callback(): KoaRouter.Middleware<any, {}>[];
|
|
20
|
+
multer(options: PlatformMulterSettings): PlatformMulter;
|
|
21
|
+
statics(path: string, options: PlatformStaticsOptions): this;
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-koa",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.90.0",
|
|
4
4
|
"description": "Koa package for Ts.ED framework",
|
|
5
|
-
"source": "./src/index.ts",
|
|
6
|
-
"main": "./lib/index.js",
|
|
7
|
-
"typings": "./lib/index.d.ts",
|
|
8
5
|
"private": false,
|
|
6
|
+
"source": "./src/index.ts",
|
|
7
|
+
"main": "./lib/cjs/index.js",
|
|
8
|
+
"typings": "./lib/types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"import": "./lib/esm/index.js",
|
|
12
|
+
"require": "./lib/cjs/index.js",
|
|
13
|
+
"default": "./lib/esm/index.js"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "yarn run build:esm && yarn run build:cjs",
|
|
17
|
+
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
18
|
+
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
19
|
+
"start": "ts-node -r tsconfig-paths/register test/app/index.ts"
|
|
20
|
+
},
|
|
9
21
|
"keywords": [
|
|
10
22
|
"Koa",
|
|
11
23
|
"TypeScript",
|
|
@@ -35,16 +47,12 @@
|
|
|
35
47
|
},
|
|
36
48
|
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/platform/platform-koa",
|
|
37
49
|
"repository": "https://github.com/tsedio/tsed",
|
|
38
|
-
"scripts": {
|
|
39
|
-
"build": "tsc --build tsconfig.compile.json",
|
|
40
|
-
"start": "ts-node -r tsconfig-paths/register test/app/index.ts"
|
|
41
|
-
},
|
|
42
50
|
"devDependencies": {
|
|
43
51
|
"@koa/cors": "3.1.0",
|
|
44
|
-
"@tsed/common": "6.
|
|
45
|
-
"@tsed/core": "6.
|
|
46
|
-
"@tsed/di": "6.
|
|
47
|
-
"@tsed/platform-test-utils": "6.
|
|
52
|
+
"@tsed/common": "6.90.0",
|
|
53
|
+
"@tsed/core": "6.90.0",
|
|
54
|
+
"@tsed/di": "6.90.0",
|
|
55
|
+
"@tsed/platform-test-utils": "6.90.0",
|
|
48
56
|
"@types/koa": "2.11.3",
|
|
49
57
|
"@types/koa-bodyparser": "4.3.0",
|
|
50
58
|
"@types/koa-compose": "3.2.5",
|
|
@@ -69,13 +77,13 @@
|
|
|
69
77
|
"tslib": "2.2.0"
|
|
70
78
|
},
|
|
71
79
|
"peerDependencies": {
|
|
72
|
-
"@tsed/common": "^6.
|
|
73
|
-
"@tsed/core": "^6.
|
|
74
|
-
"@tsed/di": "^6.
|
|
75
|
-
"@tsed/json-mapper": "^6.
|
|
80
|
+
"@tsed/common": "^6.90.0",
|
|
81
|
+
"@tsed/core": "^6.90.0",
|
|
82
|
+
"@tsed/di": "^6.90.0",
|
|
83
|
+
"@tsed/json-mapper": "^6.90.0",
|
|
76
84
|
"@tsed/logger": ">=6.0.0",
|
|
77
|
-
"@tsed/openspec": "^6.
|
|
78
|
-
"@tsed/schema": "^6.
|
|
85
|
+
"@tsed/openspec": "^6.90.0",
|
|
86
|
+
"@tsed/schema": "^6.90.0",
|
|
79
87
|
"koa": ">=2.13.0",
|
|
80
88
|
"koa-bodyparser": ">=4.3.0",
|
|
81
89
|
"koa-compress": ">=5.0.1",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.compile.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"module": "ES2020",
|
|
6
|
+
"rootDir": "src",
|
|
7
|
+
"outDir": "./lib/esm",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"declarationDir": "./lib/types"
|
|
10
|
+
},
|
|
11
|
+
"exclude": [
|
|
12
|
+
"node_modules",
|
|
13
|
+
"test",
|
|
14
|
+
"lib",
|
|
15
|
+
"benchmark",
|
|
16
|
+
"coverage",
|
|
17
|
+
"spec",
|
|
18
|
+
"**/*.benchmark.ts",
|
|
19
|
+
"**/*.spec.ts",
|
|
20
|
+
"keys",
|
|
21
|
+
"jest.config.js"
|
|
22
|
+
]
|
|
23
|
+
}
|