assign-filter
v1.0.2
Published
Object.assign that allows filtering of the copied keys from source objects
Downloads
13
Maintainers
Readme
assign-filter
Object.assign that allows filtering of the copied keys from source objects
Install
$ npm i assign-filter --save
Usage
var assignFilter = require('assign-filter')
var isDefined = function(value, prop, object) {
return value !== undefined
}
var target = {}
//only copy defined properties
assignFilter(isDefined, target, { a: undefined, b: 1 }, { c: 2 })
//target is { b: 1, c: 2 }