1.0.0 • Published 4 years ago

@jswork/next-merge v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

next-merge

Recursively merges own enumerable properties of the source object(s).

version license size download

installation

npm install -S @jswork/next-merge

usage

import '@jswork/next-merge';

const object = {
  'a': [{ 'b': 2 }, { 'd': 4 }]
};
 
const other = {
  'a': [{ 'c': 3 }, { 'e': 5 }]
};
 
const res = nx.merge(object, other);
conosle.log(res);
conosle.log(res === object);

// { a: [ { b: 2, c: 3 }, { d: 4, e: 5 } ] }
// true

license

Code released under the MIT license.