@types/koa-bodyparser
Advanced tools
Comparing version 4.3.6 to 4.3.7
@@ -78,5 +78,5 @@ // Type definitions for koa-bodyparser 4.3 | ||
extendTypes?: { | ||
json?: string[] | undefined; | ||
form?: string[] | undefined; | ||
text?: string[] | undefined; | ||
json?: string[] | string | undefined; | ||
form?: string[] | string | undefined; | ||
text?: string[] | string | undefined; | ||
} | undefined; | ||
@@ -83,0 +83,0 @@ |
{ | ||
"name": "@types/koa-bodyparser", | ||
"version": "4.3.6", | ||
"version": "4.3.7", | ||
"description": "TypeScript definitions for koa-bodyparser", | ||
@@ -40,4 +40,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-bodyparser", | ||
}, | ||
"typesPublisherContentHash": "3e56c3ca0c7f1983033da98d9300e210c1e53003704b5ac292869af71df086ce", | ||
"typesPublisherContentHash": "1694be553bd473bf73eb3a0ab2be295414fa61150427998b6e50e98ee89d0e4c", | ||
"typeScriptVersion": "3.9" | ||
} |
@@ -9,99 +9,5 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-bodyparser. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-bodyparser/index.d.ts) | ||
````ts | ||
// Type definitions for koa-bodyparser 4.3 | ||
// Project: https://github.com/koajs/body-parser | ||
// Definitions by: Jerry Chin <https://github.com/hellopao> | ||
// Hiroshi Ioka <https://github.com/hirochachacha> | ||
// Alexi Maschas <https://github.com/amaschas> | ||
// Pirasis Leelatanon <https://github.com/1pete> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
/* =================== USAGE =================== | ||
import bodyParser = require("koa-bodyparser"); | ||
var Koa = require('koa'); | ||
var app = new Koa(); | ||
app.use(bodyParser()); | ||
=============================================== */ | ||
import * as Koa from "koa"; | ||
declare module "koa" { | ||
interface Request { | ||
body?: any; | ||
rawBody: string; | ||
} | ||
} | ||
declare function bodyParser(opts?: bodyParser.Options): Koa.Middleware; | ||
declare namespace bodyParser { | ||
interface Options { | ||
/** | ||
* parser will only parse when request type hits enableTypes, default is ['json', 'form']. | ||
*/ | ||
enableTypes?: string[] | undefined; | ||
/** | ||
* requested encoding. Default is utf-8 by co-body | ||
*/ | ||
encoding?: string | undefined; | ||
/** | ||
* limit of the urlencoded body. If the body ends up being larger than this limit | ||
* a 413 error code is returned. Default is 56kb | ||
*/ | ||
formLimit?: string | undefined; | ||
/** | ||
* limit of the json body. Default is 1mb | ||
*/ | ||
jsonLimit?: string | undefined; | ||
/** | ||
* limit of the text body. Default is 1mb. | ||
*/ | ||
textLimit?: string | undefined; | ||
/** | ||
* limit of the xml body. Default is 1mb. | ||
*/ | ||
xmlLimit?: string | undefined; | ||
/** | ||
* when set to true, JSON parser will only accept arrays and objects. Default is true | ||
*/ | ||
strict?: boolean | undefined; | ||
/** | ||
* custom json request detect function. Default is null | ||
*/ | ||
detectJSON?: ((ctx: Koa.Context) => boolean) | undefined; | ||
/** | ||
* support extend types | ||
*/ | ||
extendTypes?: { | ||
json?: string[] | undefined; | ||
form?: string[] | undefined; | ||
text?: string[] | undefined; | ||
} | undefined; | ||
/** | ||
* support custom error handle | ||
*/ | ||
onerror?: ((err: Error, ctx: Koa.Context) => void) | undefined; | ||
} | ||
} | ||
export = bodyParser; | ||
```` | ||
### Additional Details | ||
* Last updated: Fri, 04 Mar 2022 18:31:48 GMT | ||
* Last updated: Mon, 21 Mar 2022 18:31:55 GMT | ||
* Dependencies: [@types/koa](https://npmjs.com/package/@types/koa) | ||
@@ -108,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5661
17