Skip to content
This repository was archived by the owner on Sep 6, 2020. It is now read-only.

Commit aba7246

Browse files
committed
Need to have an initial value for reducing empty arrays
1 parent 310e4e2 commit aba7246

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Model.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ module.exports = class Model {
156156
only: definition.data
157157
}
158158
}
159-
159+
160160
var result = key => {
161161
var value = _.get(definition, 'data.' + key);
162162
return _.isFunction(value) ? value.call(this.data, definition) : value;
@@ -191,7 +191,7 @@ module.exports = class Model {
191191
[value]: _.get(this.data, value)
192192
}
193193
})
194-
.reduce(_.merge);
194+
.reduce(_.merge, {});
195195

196196
for (const [key, value] of Object.entries(payload)) {
197197
if (_.isFunction(value)) {

0 commit comments

Comments
 (0)