1.0.1 • Published 4 years ago
uinix-fp-is-truthy v1.0.1
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-truthyUse
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); // falseAPI
This package exports the following identifiers: isTruthy. There is no default export.
isTruthy(x)
Parameters
x(X) — Any value
Returns
boolean— Boolean value ifxis JS-truthy.