Merge objects and concatenating arrays inside them
npm install --save merge-and-concat
import mergeAndConcat from 'merge-and-concat';
mergeAndConcat(
{ hey: 'hey', list: [1, 2] },
{ ho: 'ho', list: [3, 4] },
{ uni: 'corns' }
); // { hey: 'hey', ho: 'ho', uni: 'corns', list: [1, 2, 3, 4] }
// removing dupes
mergeAndConcat(
{ after_script: ['npm run coverage'] },
{ after_script: ['npm run coverage'] }
); // { after_script: ['npm run coverage'] }
Required
Type: each item is Object
Set of objects
MIT © Vladimir Starkov