uinix-fp-is-truthy
v1.0.1
Published
uinix fp utility to test JS-truthiness of values
Downloads
16
Maintainers
Readme
uinix-fp-is-truthy
uinix-fp
utility to test JS-truthiness of values.
Install
This package is ESM-only and requires Node 12+.
npm install uinix-fp-is-truthy
Use
isTruthy
is a predicate testing JS-truthiness of the provided value.
import {isTruthy} from 'uinix-fp-is-truthy';
isTruthy(true); // true
isTruthy('a'); // true
isTruthy(1); // true
isTruthy([]); // true
isTruthy({}); // true
isTruthy(); // false
isTruthy(false); // false
isTruthy(null); // false
isTruthy(''); // false
isTruthy(0); // false
API
This package exports the following identifiers: isTruthy
. There is no default export.
isTruthy(x)
Parameters
x
(X
) — Any value
Returns
boolean
— Boolean value ifx
is JS-truthy.