whitelist-merge
v1.0.1
Published
Merge 2 objects including only properties from supplied whitelist array
Downloads
523
Readme
whitelist-merge
Merge 2 objects including only properties from supplied whitelist array
Installation
npm install whitelist-merge --save
Usage
const object1 = {name: 'bob', gender: 'male'}
const object2 = {age: 23, weight: '2.3'}
const whitelist = ['name', 'age']
merge(object1, object2, whitelist)
// -> {name: 'bob', age: 23}