Recursively omit empty properties from an object. Omits empty objects, arrays, strings or zero.
npm i -s @mikepol/omit-empty
import omitEmpty from '@mikepol/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}
omitEmpty({a: null, b: ''});
//=> null
npm install && npm test