Skip to content

Commit

Permalink
Export koa-bodyparser as a CommonJS module (#2174)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinGrandon authored and gantoine committed May 17, 2018
1 parent 5b150db commit e969a7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -21,5 +21,5 @@ declare module "koa-bodyparser" {
onerror?: (err: Error, ctx: Context) => void
|};

declare export default function bodyParser(opts?: Options): Middleware;
declare module.exports: (opts?: Options) => Middleware;
}
Expand Up @@ -14,3 +14,7 @@ bodyParser({ strict: true });
// $ExpectError (Must use valid types for options)
bodyParser({ formLimit: 56 });
bodyParser({ formLimit: "56kb" });

// Should work when requiring koa-bodyparser
var requiredBodyParser = require('koa-bodyparser');
requiredBodyParser();

0 comments on commit e969a7a

Please sign in to comment.