Comparing version 1.1.0-beta.5 to 1.1.0-beta.6
{ | ||
"name": "astroboy", | ||
"version": "1.1.0-beta.5", | ||
"version": "1.1.0-beta.6", | ||
"description": "Astroboy(阿童木)is a Nodejs SFB(Separation of Front and Back ends) framework, built on koa2.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
import { MiddlewareFactory } from '../../../../definitions'; | ||
declare const factory: MiddlewareFactory<any, any>; | ||
import { IOptions } from '../../contract'; | ||
declare const factory: MiddlewareFactory<Partial<IOptions>, any>; | ||
export = factory; |
@@ -9,3 +9,3 @@ "use strict"; | ||
const factory = (options, app) => { | ||
let fn = options.parser === 'koa-bodyparser' ? bodyParser(options) : koaBody(options); | ||
const fn = options.parser === 'koa-bodyparser' ? bodyParser(options) : koaBody(options); | ||
fn._name = 'body'; | ||
@@ -12,0 +12,0 @@ return fn; |
import { IMiddlewareOptions } from '../../definitions/config'; | ||
export interface IOptions { | ||
parser: string; | ||
multipart: boolean; | ||
jsonLimit: string; | ||
formLimit: string; | ||
textLimit: string; | ||
strict: boolean; | ||
formidable: { | ||
uploadDir?: string; | ||
}; | ||
} | ||
export interface IAstroboyBodyPluginMiddlewareExtends { | ||
'astroboy-body': IMiddlewareOptions<{ | ||
formidable?: { | ||
uploadDir?: string; | ||
}; | ||
multipart?: boolean; | ||
jsonLimit?: string; | ||
formLimit?: string; | ||
textLimit?: string; | ||
strict?: boolean; | ||
}>; | ||
'astroboy-body': IMiddlewareOptions<Partial<IOptions>>; | ||
} |
Sorry, the diff of this file is not supported yet
129236
2175