merge-array-object

1.0.6 • Public • Published

merge

CI npm version NPM Downloads Coverage Status

Concat array and merge object

Install

npm i merge-array-object

Usage

var merge = require('merge-array-object');

var a = {a: [1], b: 1, c: 1 }; 
var b = {a: [2], b: 2, d: 2 };

var result = merge(a,b);

// result
{
  a: [1, 2],
  b: 2,
  c: 1,
  d: 2
}

noDuplicates

var a = {ary: ['foo', 'bar']};
var b = {ary: ['bar', 'baz']};

console.log(merge.noDuplicates(b, a));  // {ary: ['foo', 'bar', 'baz']}
console.log(merge(b, a));               // {ary: ['foo', 'bar', 'bar', 'baz']}

Contributors

As always, thanks to our amazing contributors!

Made with contributors.

License

Licensed under the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i merge-array-object

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

136 kB

Total Files

30

Last publish

Collaborators

  • wcjiang