Hello, just wondering if this is intentional or not? It feels misleading and like it could lead to runtime bugs
rawBody is declared as a string:
|
declare module 'koa' { |
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions |
|
interface Request { |
|
body?: unknown; |
|
rawBody: string; |
|
} |
|
} |
but in practice it will be undefined if a suitable body type is not found:
|
if (!bodyType) return {} as Record<string, string>; |
Thank you!
Hello, just wondering if this is intentional or not? It feels misleading and like it could lead to runtime bugs
rawBodyis declared as astring:bodyparser/src/body-parser.ts
Lines 9 to 15 in 7e1ded3
but in practice it will be
undefinedif a suitable body type is not found:bodyparser/src/body-parser.ts
Line 60 in 7e1ded3
Thank you!