uinix-fp
utility to test JS-truthiness of values.
This package is ESM-only and requires Node 12+.
npm install uinix-fp-is-truthy
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
This package exports the following identifiers: isTruthy
. There is no default export.
-
x
(X
) — Any value
-
boolean
— Boolean value ifx
is JS-truthy.