is-truthy-x
Version:
Test if a given value is truthy.
15 lines (12 loc) • 336 B
JavaScript
import toBoolean from 'to-boolean-x';
/**
* This method tests if a given value is truthy.
*
* @function isTruthy
* @param {*} [value] - The value to test.
* @returns {boolean} `true` if the value is truthy: otherwise `false`.
*/
const isTruthy = function isTruthy(value) {
return toBoolean(value);
};
export default isTruthy;