UNPKG

ramda-adjunct

Version:

Ramda Adjunct is the most popular and most comprehensive set of utilities for use with Ramda, providing a variety of useful, well tested functions with excellent documentation.

27 lines (26 loc) 901 B
import { curryN } from 'ramda'; /** * In JavaScript, a `truthy` value is a value that is considered true * when evaluated in a Boolean context. All values are truthy unless * they are defined as falsy (i.e., except for `false`, `0`, `""`, `null`, `undefined`, and `NaN`). * * @func isTruthy * @memberOf RA * @since {@link https://char0n.github.io/ramda-adjunct/2.2.0|v2.2.0} * @category Type * @sig * -> Boolean * @param {*} val The value to test * @return {boolean} * @see {@link https://developer.mozilla.org/en-US/docs/Glossary/Truthy|truthy}, {@link RA.isFalsy|isFalsy} * @example * * RA.isTruthy({}); // => true * RA.isTruthy([]); // => true * RA.isTruthy(42); // => true * RA.isTruthy(3.14); // => true * RA.isTruthy('foo'); // => true * RA.isTruthy(new Date()); // => true * RA.isTruthy(Infinity); // => true */ var isTruthy = curryN(1, Boolean); export default isTruthy;