Skip to content

Merge two objects and concatenate arrays that are values of the same object key.

License

Notifications You must be signed in to change notification settings

alexshevch/node-merge-objects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-merge-objects

Merge two objects and concatenate arrays that are values of the same object key.

Similar to extend in JQuery, but with arrays concatenation. Does deep merging too.

Build Status

Installation

npm install merge-objects --save

Usage

var merge = require('merge-objects');

var object1 = {a: 1, b: [2, 3]};
var object2 = {b: [4, 5], c: 6};

var result = merge(object1, object2);
console.log(result); //logs {a: 1, b: [2, 3, 4, 5], c: 6}

License

MIT

About

Merge two objects and concatenate arrays that are values of the same object key.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published