JSPM

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

Recursively omit empty properties from an object. Omits empty objects, arrays, strings or zero.

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 NPM version Build Status

Recursively omit empty properties from an object. Omits empty objects, arrays, strings or zero.

(TOC generated by verb using markdown-toc)

Install

Install with npm

$ npm i 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}
  • arrayify-compact: Casts the given value to a flatten array, and removes falsey items (similar to lodash… more | homepage
  • compact-object: Similar to omit-empty, recursively omits empty properties, but also compacts/flattens nested arrays in an object. | homepage
  • delete: Delete files and folders and any intermediate directories if they exist (sync and async). | homepage
  • flatten-object: Flatten a nested object | homepage
  • 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
  • has-any: Returns true if an object has any of the specified keys. | homepage
  • has-value: Returns true if a value exists, false if empty. Works with deeply nested values using… more | homepage
  • is-number: Returns true if the value is a number. comprehensive tests. | homepage
  • is-plain-object: Returns true if an object was created by the Object constructor. | homepage
  • mixin-deep: Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | homepage
  • mixin-object: Mixin the own and inherited properties of other objects onto the first object. Pass an… more | homepage
  • object-length: Get the length of an object's properties, excluding prototype properties. Works with dontEnum bugs. | homepage
  • omit-empty: Recursively omit empty properties from an object. Omits empty objects, arrays, strings or zero. | homepage
  • reduce-object: Reduces an object to a value that is the accumulated result of running each property… more | homepage

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb on December 24, 2015.