mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Make notEmpty more robust
This commit is contained in:
parent
452a695e20
commit
13fb3b8b78
@ -9,10 +9,15 @@ var markoRegExp = /\.marko(.xml)?$/;
|
|||||||
var req = require;
|
var req = require;
|
||||||
|
|
||||||
function notEmpty(o) {
|
function notEmpty(o) {
|
||||||
if (Array.isArray(o) === true) {
|
if (o == null) {
|
||||||
return o.length !== 0;
|
return false;
|
||||||
|
} else if (Array.isArray(o)) {
|
||||||
|
return !!o.length;
|
||||||
|
} else if (o === '') {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return o;
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user