mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #30569 from hirochachacha/koa-bodyparser
@types/koa-bodyparser: use any for Request.body
This commit is contained in:
Vendored
+6
-4
@@ -1,6 +1,8 @@
|
||||
// Type definitions for koa-bodyparser 5.0
|
||||
// Type definitions for koa-bodyparser 4.2
|
||||
// Project: https://github.com/koajs/bodyparser
|
||||
// Definitions by: Jerry Chin <https://github.com/hellopao>, Anup Kishore <https://github.com/anup-2s>
|
||||
// Definitions by: Jerry Chin <https://github.com/hellopao>
|
||||
// Anup Kishore <https://github.com/anup-2s>
|
||||
// Hiroshi Ioka <https://github.com/hirochachacha>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -18,8 +20,8 @@ import * as Koa from "koa";
|
||||
|
||||
declare module "koa" {
|
||||
interface Request {
|
||||
body: {} | null | undefined;
|
||||
rawBody: {} | null | undefined;
|
||||
body: any;
|
||||
rawBody: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ app.use(bodyParser({ strict: false }));
|
||||
|
||||
app.use((ctx) => {
|
||||
console.log(ctx.request.body);
|
||||
console.log(ctx.request.body.ok);
|
||||
console.log(ctx.request.rawBody);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user