object-compact

remove null/undefined values from objects


Keywords
object, filter, compact, null, undefined
License
MIT
Install
npm install object-compact@1.0.1

Documentation

object-compact NPM version Build Status Dependency Status Coverage percentage

remove null/undefined values recursively from objects

Installation

$ npm install --save object-compact

Usage

const objectCompact = require('object-compact');

objectCompact({
  bar: 'Hello',
  baz: null,
  foo: {
    bar: 'World !',
    baz: null
  }
});
/*
=>
{
  bar: 'Hello',
  foo: {
    bar: 'World !'
  }
}
*/

License

MIT © Gabriel