Skip to content

Commit

Permalink
fix: Use .apply(this, args) for wrapped handler instead
Browse files Browse the repository at this point in the history
  • Loading branch information
kolanos committed Mar 15, 2019
1 parent 937f4fe commit b656af4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ function wrapHandler() {
return iopipe(importedModule[handlerToWrap]);
}

module.exports.handler = (event, context, callback) => {
module.exports.handler = function handler(...args) {
if (!wrappedHandler) {
wrappedHandler = wrapHandler();
}

return wrappedHandler(event, context, callback);
return wrappedHandler.apply(this, args);
};

0 comments on commit b656af4

Please sign in to comment.