@zippytech/assign-filter
v2.0.1
Published
Object.assign that allows filtering of the copied keys from source objects
Downloads
4
Maintainers
Readme
assign-filter
Object.assign that allows filtering of the copied keys from source objects
Install
$ npm i @zippytech/assign-filter --save
Usage
var assignFilter = require('@zippytech/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 }