whitelist-merge

Merge 2 objects including only properties from supplied whitelist array


Keywords
merge, whitelist
License
MIT
Install
npm install whitelist-merge@1.0.1

Documentation

whitelist-merge

Merge 2 objects including only properties from supplied whitelist array

NPM

Media Suite

Build Status

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}