Skip to content

jonyonson/only-truthy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

only-truthy

build npm version

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 };

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published