diff --git a/runtime/helpers.js b/runtime/helpers.js index 17b3f5f37..c6bac7d54 100644 --- a/runtime/helpers.js +++ b/runtime/helpers.js @@ -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 = {