/** * @file Converts argument to a value of type Boolean. * @version 1.0.1 * @author Xotic750 * @copyright Xotic750 * @license {@link MIT} * @module to-boolean-x */ 'use strict'; /** * The abstract operation ToBoolean converts argument to a value of type Boolean. * * @param {*} value - The value to be converted. * @returns {boolean} 'true' if value is truthy; otherwise 'false'. * @example * var toBoolean = require('to-boolean-x'); * * toBoolean(null); // false * toBoolean(''); // false * toBoolean(1); // true * toBoolean('0'); // true */ module.exports = function toBoolean(value) { return !!value; };