From 9f22f5e16eac3bd10d6104bfb685fa97d412aa62 Mon Sep 17 00:00:00 2001 From: Anup Kishore Date: Wed, 6 Jun 2018 15:08:42 -0400 Subject: [PATCH] Update koa-bodyparser Parsed body should be `unknown` type (simulated until release in Typescript 3.0). Any manipulations on `body` should come with type assertions and/or verification. Note, this is a major change, and a significant tightening of type safety. --- types/koa-bodyparser/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/koa-bodyparser/index.d.ts b/types/koa-bodyparser/index.d.ts index 256a2fad0a..1664e86cac 100644 --- a/types/koa-bodyparser/index.d.ts +++ b/types/koa-bodyparser/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for koa-bodyparser 4.2 +// Type definitions for koa-bodyparser 5.0 // Project: https://github.com/koajs/bodyparser -// Definitions by: Jerry Chin +// Definitions by: Jerry Chin , Anup Kishore // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -18,8 +18,8 @@ import * as Koa from "koa"; declare module "koa" { interface Request { - body: any; - rawBody: any; + body: {} | null | undefined; + rawBody: {} | null | undefined; } }