1.0.0 • Published 10 years ago
strip-falsy v1.0.0
strip-falsy
Strip falsy properties from an object.
Note: The package actually creates a new object that has all of the non-falsy properties of the input instead of deleting the properties. This is done for performance reasons.
Install
$ npm install --save strip-falsyUsage
var strip = require('strip-falsy')
var input = {
a: false
, b: 0
, c: null
, d: undefined
, e: ''
, f: 'biscuits'
, g: '0'
}
var out = strip(input)
// => { f: 'biscuits', g: '0' }Test
$ npm testAuthor
Evan Lucas
License
MIT (See LICENSE for more info)
1.0.0
10 years ago