JSPM

assign-filter

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q11952F
  • License MIT

Object.assign that allows filtering of the copied keys from source objects

Package Exports

  • assign-filter

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (assign-filter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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 }

License

MIT