mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* add request.body
* Update koa-bodyparser.d.ts
According to the documentation of `koa-bodyparser`:
```javascript
// the parsed body will store in this.request.body
// if nothing was parsed, body will be an empty object {}
ctx.body = ctx.request.body;
```
Therefore the `body` property will exit in the `request` object.
Changing the `body` property from optional to required can also fix the conflict problem in Koa's declaration file:
```ts
class Koa extend Request, Response {}
```
|
||
|---|---|---|
| .. | ||
| koa-bodyparser-tests.ts | ||
| koa-bodyparser.d.ts | ||