whitelist-merge

v1.0.0
Merge 2 objects including only properties from supplied whitelist array
merge whitelist

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}

Metadata

  • MIT
  • >=4.2.0
  • Richard Walker
  • released 12/13/2015

Downloads

Maintainers