Prune objects from non-values
npm install --save object-prune
const prune = require('object-prune')
Walk an object recursively and remove
- keys with empty string values
- keys with object values without keys
- keys with array values without elements
prune({one: "", two: [], three: {}, four: 4}) // # {four: 4}
prune({one: "", two: [], three: {}, four: 4}) // # {two: [], three: {}, four: 4}
prune({one: "", two: [], three: {}, four: 4}) // # {one: "", three: {}, four: 4}
prune({one: "", two: [], three: {}, four: 4}) // # {one: "", two: [], four: 4}