uinix-fp-is-truthy

uinix fp utility to test JS-truthiness of values

Usage no npm install needed!

<script type="module">
  import uinixFpIsTruthy from 'https://cdn.skypack.dev/uinix-fp-is-truthy';
</script>

README

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