are-message
Version:
This is a React global notification message component. It is a standalone implementation of the are-visual message component.
24 lines (19 loc) • 456 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isTruthy = isTruthy;
/**
* 过滤 undefined, null, '', NaN
*/
function isTruthy(value) {
var notEmptyStr = true;
var notNaN = true;
if (typeof value === 'string') {
notEmptyStr = value.trim() !== '';
}
if (typeof value === 'number') {
notNaN = !Number.isNaN(value);
}
return value !== undefined && value !== null && notEmptyStr && notNaN;
}