@himynameisdave/utils.is-truthy
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

@himynameisdave/utils.is-truthy

Test if a given element is truthy.


Test if a given element is truthy (by casting input to a boolean).

Examples

import isTruthy from '@himynameisdave/utils.is-truthy';

isTruthy(true); // true
isTruthy(false); // false
isTruthy(1); // true
isTruthy(0); // false
isTruthy('foo'); // true
isTruthy(''); // false
isTruthy([1,2,3]); // true

Readme

Keywords

none

Package Sidebar

Install

npm i @himynameisdave/utils.is-truthy

Weekly Downloads

1

Version

0.5.0

License

MIT

Unpacked Size

3.18 kB

Total Files

5

Last publish

Collaborators

  • himynameisdave