Skip to content

Commit

Permalink
Fix error thrown when group() is called with no arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
LeaVerou committed Feb 1, 2021
1 parent 8ff3eba commit c5979b1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,13 @@ var _ = Mavo.Functions = {
return val(condition)? iftrue : iffalse;
},

group: (...objects) => Object.assign(...objects),
group: (...objects) => {
if (objects.length === 0) {
return {};
}

return Object.assign(...objects);
},
list: (...items) => items.flat(),

// FIXME if step=0 returns NaN
Expand Down

0 comments on commit c5979b1

Please sign in to comment.