boolean-filter-obj
v2.0.0
Published
Filter an object, preserving only truthy values
Downloads
230
Maintainers
Readme
boolean-filter-obj
Filter an object, preserving only truthy values
Install
$ npm install --save boolean-filter-obj
Usage
var filter = require('boolean-filter-obj')
filter({a: 1, b: 0, c: false, d: 'foo'})
//=> {a: 1, d: 'foo'}
API
filter(obj)
-> object
Returns a new object with only the truthy values.
obj
Required
Type: object
License
MIT © Ben Drucker