1-liners
Version:
Useful oneliners and shorthand functions
29 lines (26 loc) • 494 B
JavaScript
/**
* @module 1-liners/isTruthy
*
* @description
*
* Same as `!!`.
*
* @example
*
* const isTruthy = require('1-liners/isTruthy');
*
* isTruthy('yes'); // => true
* isTruthy(true); // => true
* isTruthy([]); // => true
*
* isTruthy(''); // => false
* isTruthy(0); // => false
* isTruthy(false); // => false
*
*/
;
exports.__esModule = true;
exports["default"] = function (x) {
return !!x;
};
module.exports = exports["default"];