overwrite-object
A tiny module to merge two objects and overwrite values cleverly.
Installation
npm install overwrite-object
Example
var overwriteObject = ; var obj1 = name: first: 'John' last: 'Smith' age: 30 hobbies: 'mountain climbing' 'pets' ;var obj2 = name: title: 'Mr' age: 'N.A.' hobbies: 'eating out' 'long walks in the park' ; var newObj = ;
will produce
var newObj = name: first: 'John' last: 'Smith' title: 'Mr' age: 'N.A.' hobbies: 'mountain climbing' 'pets' 'eating out' 'long walks in the park' ;