tui-code-snippet
Version:
TOAST UI Utility: CodeSnippet
23 lines (18 loc) • 553 B
JavaScript
/**
* @fileoverview Check whether the given variable is truthy or not.
* @author NHN FE Development Lab <dl_javascript@nhn.com>
*/
;
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;