Package Exports
- omit-empty
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 (omit-empty) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
omit-empty

Recursively omit empty properties from an object. Omits empty objects, arrays, strings or zero.
Install
Install with npm:
$ npm install omit-empty --save
Usage
var omitEmpty = require('omit-empty');
omitEmpty({a: 'a', b: ''});
//=> {a: 'a'}
omitEmpty({a: 'a', b: {c: 'c', d: ''}});
//=> {a: 'a', b: {c: 'c'}
omitEmpty({a: ['a'], b: []});
//=> {a: ['a']}
omitEmpty({a: 0, b: 1});
//=> {a: 0, b: 1}
// set the `noZero` flag
omitEmpty({a: 0, b: 1}, true);
//=> {b: 1}
Related projects
You might also be interested in these projects:
- for-in: Iterate over the own and inherited enumerable properties of an objecte, and return an object… more | homepage
- for-own: Iterate over the own enumerable properties of an object, and return an object with properties… more | homepage
- is-plain-object: Returns true if an object was created by the
Object
constructor. | homepage - reduce-object: Reduces an object to a value that is the accumulated result of running each property… more | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Building docs
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Running tests
Install dev dependencies:
$ npm install -d && npm test
Author
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on April 09, 2016.