only-truthy
v1.0.2
Published
Returns a new object with ALL object properties with [falsy values](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) removed. ## Install ```sh npm install only-truthy ```
Downloads
3
Readme
only-truthy
Returns a new object with ALL object properties with falsy values removed.
Install
npm install only-truthy
Usage
import onlyTruthy from 'only-truthy';
const obj = onlyTruthy({
a: true,
b: false,
c: null,
d: undefined,
e: NaN,
f: '',
g: 0,
});
console.log(obj);
// => { a: true };