marko/helpers/notEmpty.js
2016-08-19 14:06:30 -06:00

11 lines
220 B
JavaScript

module.exports = function notEmpty(o) {
if (o == null) {
return false;
} else if (Array.isArray(o)) {
return !!o.length;
} else if (o === '') {
return false;
}
return true;
};