diff --git a/lib/main.js b/lib/main.js index 748dbfcb..73695413 100644 --- a/lib/main.js +++ b/lib/main.js @@ -64,7 +64,7 @@ Lambda.prototype.run = function (program) { const event = require(path.join(process.cwd(), program.eventFile)) const context = require(path.join(process.cwd(), program.contextFile)) - if (Object.prototype.toString.call(event) !== '[object Array]') { + if (!Array.isArray(event)) { return this._runHandler(handler, event, program, context) } this._runMultipleHandlers(event) @@ -213,7 +213,7 @@ Lambda.prototype._eventSourceList = function (program) { } })() - if (Object.prototype.toString.call(list) === '[object Array]') { + if (Array.isArray(list)) { // backward-compatible return { EventSourceMappings: list,