Make notEmpty more robust

This commit is contained in:
Patrick Steele-Idem 2014-10-20 12:30:05 -06:00
parent 452a695e20
commit 13fb3b8b78

View File

@ -9,10 +9,15 @@ var markoRegExp = /\.marko(.xml)?$/;
var req = require;
function notEmpty(o) {
if (Array.isArray(o) === true) {
return o.length !== 0;
if (o == null) {
return false;
} else if (Array.isArray(o)) {
return !!o.length;
} else if (o === '') {
return false;
}
return o;
return true;
}
module.exports = {