Closed edevil closed 5 years ago
This seems reasonable enough to me.
Pinging @egilsster @damianb @ErikAugust and @naxmefy who have PR'd prior fixes for type definitions for comments/feedback
This is going to cause errors where you are accessing properties on the body
object since it contains no key index, so I think something along the lines of body: { [key: string]: any } | null | undefined
gives us a clearer picture of what this object might be. That said, that will require a set of PRs for the other libraries in question to solve your issue here.
Dug into why koa-bodyparser's typings are how they are currently. They changed, recently, from any
to that weird typing, which honestly I really don't care for. It renders koa-bodyparser much harder to use all for the sake of (poorly) emulating a feature to come in later-coming typescript versions (ugh).
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26330
The changes in koa-bodyparser's typings, by the way, have since been reverted: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/90961b6110f9848311859f25b600d9e25e9bd783/types/koa-bodyparser/index.d.ts#L21-L26
Revert happened in this PR on DT'd: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30569
This PR should be closed, IMO.
Thanks @damianb!
npm i --save-dev @types/koa-bodyparser@latest
Addresses #118.