deep-prune
v0.2.0
Published
```javascript import { deepPrune } from "deep-prune";
Downloads
2
Readme
Deeply prunes null
or undefined
values from an array or object.
You can also customize the values that get pruned.
Usage
import { deepPrune } from "deep-prune";
deepPrune({ foo: null, bar: 100 });
// { bar: 100 }
deepPrune([1, null, undefined, ""]);
// [1, ""]
deepPrune([{ foo: { bar: null, buzz: 2 } }]);
// [{ foo: { buzz: 2 } }]
deepPrune([1, 2, 3], value => value === 1);
// [2, 3]