summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/utils.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-01-13 15:53:06 -0600
committerkpdecker <kpdecker@gmail.com>2013-01-13 15:53:06 -0600
commit5f56d6582f9f457fc754ddc1027a1fce87909b3e (patch)
tree0c479c21ebd0b8e79939310505ff873aaac9c257 /lib/handlebars/utils.js
parent3cac2672d0069b95f7b93c9c4727392246cd8984 (diff)
downloadhandlebars.js-5f56d6582f9f457fc754ddc1027a1fce87909b3e.zip
handlebars.js-5f56d6582f9f457fc754ddc1027a1fce87909b3e.tar.gz
handlebars.js-5f56d6582f9f457fc754ddc1027a1fce87909b3e.tar.bz2
Simplify isEmpty
Diffstat (limited to 'lib/handlebars/utils.js')
-rw-r--r--lib/handlebars/utils.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js
index 3bc7e9b..7539039 100644
--- a/lib/handlebars/utils.js
+++ b/lib/handlebars/utils.js
@@ -53,11 +53,7 @@ Handlebars.SafeString.prototype.toString = function() {
},
isEmpty: function(value) {
- if (typeof value === "undefined") {
- return true;
- } else if (value === null) {
- return true;
- } else if (value === false) {
+ if (!value && value !== 0) {
return true;
} else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) {
return true;