UNPKG

tui-code-snippet

Version:
23 lines (18 loc) 553 B
/** * @fileoverview Check whether the given variable is truthy or not. * @author NHN FE Development Lab <dl_javascript@nhn.com> */ 'use strict'; var isExisty = require('./isExisty'); /** * Check whether the given variable is truthy or not. * If the given variable is not null or not undefined or not false, returns true. * (It regards 0 as true) * @param {*} obj - Target for checking * @returns {boolean} Is truthy? * @memberof module:type */ function isTruthy(obj) { return isExisty(obj) && obj !== false; } module.exports = isTruthy;