koajs / bodyparser

Koa body parsing middleware
MIT License
1.31k stars 116 forks source link

refactor: avoid async keyword #88

Closed sethb0 closed 6 years ago

sethb0 commented 6 years ago

To use a transpiler such as Babel to run Koa 2.x on Node 6.x, library packages generally need to conform to Node 6 syntax (i.e., no async/await keywords). It was easy enough for me to rewrite this package to use Promise.resolve() and Promise.reject() instead of async and await, since it doesn't do anything intricate.

I also cleaned up a deprecation warning in the test suite, and updated example.js for Koa 2.x.

sethb0 commented 6 years ago

Ugh. Passes unit testing, fails integration testing in my app. I suspect shenanigans in one of the dependencies. Closing this for now until/unless I find a fix for that.