@zenweb/body
Advanced tools
| import { Core } from '@zenweb/core'; | ||
| import * as koaBody from 'koa-body'; | ||
| import { Files } from 'formidable'; | ||
| export { IKoaBodyOptions as BodyOption } from 'koa-body'; | ||
| export declare function setup(core: Core, options?: koaBody.IKoaBodyOptions): void; | ||
| declare module 'koa' { | ||
| interface Request { | ||
| body?: any; | ||
| files?: Files; | ||
| } | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.setup = void 0; | ||
| const koaBody = require("koa-body"); | ||
| function setup(core, options) { | ||
| core.use(koaBody(options)); | ||
| } | ||
| exports.setup = setup; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,oCAAoC;AAIpC,SAAgB,KAAK,CAAC,IAAU,EAAE,OAAiC;IACjE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7B,CAAC;AAFD,sBAEC"} |
+4
-1
| { | ||
| "name": "@zenweb/body", | ||
| "version": "2.0.1", | ||
| "version": "2.0.2", | ||
| "description": "Zenweb Body module", | ||
@@ -10,2 +10,5 @@ "exports": "./dist/index.js", | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "author": { | ||
@@ -12,0 +15,0 @@ "name": "YeFei", |
-16
| import { Core } from '@zenweb/core'; | ||
| import * as koaBody from 'koa-body'; | ||
| import { Files } from 'formidable'; | ||
| export { IKoaBodyOptions as BodyOption } from 'koa-body'; | ||
| export function setup(core: Core, options?: koaBody.IKoaBodyOptions) { | ||
| core.use(koaBody(options)); | ||
| } | ||
| declare module 'koa' { | ||
| interface Request { | ||
| // 不知为何 typescript 找不到 koa-body 中的 ts 定义,这里重复添加一下 | ||
| body?: any; | ||
| files?: Files; | ||
| } | ||
| } |
| { | ||
| "compilerOptions": { | ||
| "target": "ES2019", | ||
| "lib": [ | ||
| "ES2019" | ||
| ], | ||
| "module": "commonjs", | ||
| "noImplicitAny": true, | ||
| "preserveConstEnums": true, | ||
| "sourceMap": true, | ||
| "declaration": true, | ||
| "outDir": "./dist" | ||
| }, | ||
| "exclude": [ | ||
| "node_modules", | ||
| "**/*.spec.ts" | ||
| ], | ||
| "include": [ | ||
| "src/**/*" | ||
| ] | ||
| } |
1643
5.05%5
25%19
-44.12%