Skip to content

Commit 23431f2

Browse files
abetomoDeviaVir
authored andcommitted
Bugfix for backward compatible objects (#234)
1 parent e25b0fb commit 23431f2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ Lambda.prototype._eventSourceList = function (program) {
153153

154154
if (Object.prototype.toString.call(list) === '[object Array]') {
155155
// backward-compatible
156-
return { EventSourceMappings: list };
156+
return {
157+
EventSourceMappings: list,
158+
ScheduleEvents: []
159+
};
157160
}
158161
if (!list.EventSourceMappings) {
159162
list.EventSourceMappings = [];

test/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,10 @@ describe('node-lambda', function () {
593593

594594
it('program.eventSourceFile is valid value', function () {
595595
program.eventSourceFile = fileName;
596-
const expected = { EventSourceMappings: oldStyleValue };
596+
const expected = {
597+
EventSourceMappings: oldStyleValue,
598+
ScheduleEvents: []
599+
};
597600
assert.deepEqual(lambda._eventSourceList(program), expected);
598601
});
599602
});

0 commit comments

Comments
 (0)