1.0.1 • Published 2 years ago

uinix-fp-is-truthy v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

uinix-fp-is-truthy

Build Coverage Downloads Size

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 if x is JS-truthy.

License

MIT © Chris Zhou