ran npm run tdd
This commit is contained in:
9
test/merge/merge.js
Normal file
9
test/merge/merge.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = merge = (...objs) =>
|
||||
[...objs].reduce(
|
||||
(acc, obj) =>
|
||||
Object.keys(obj).reduce((a, k) => {
|
||||
acc[k] = acc.hasOwnProperty(k) ? [].concat(acc[k]).concat(obj[k]) : obj[k];
|
||||
return acc;
|
||||
}, {}),
|
||||
{}
|
||||
);
|
||||
Reference in New Issue
Block a user