diff options
author | Thom Williams <thom.williams@pnnl.gov> | 2016-08-19 13:28:17 -0700 |
---|---|---|
committer | Thom Williams <thom.williams@pnnl.gov> | 2016-08-19 13:28:17 -0700 |
commit | af54a68ffd91ff15e70166ebdd440c7f5ae9b24c (patch) | |
tree | d844d34ff92afc986b997092162e606df873620f | |
parent | f40cecc8aa983a2f4d61406ca23a7e80020ac55e (diff) | |
download | yamljs-af54a68ffd91ff15e70166ebdd440c7f5ae9b24c.tar.gz |
Update compiled Util lib
-rw-r--r-- | lib/Utils.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Utils.js b/lib/Utils.js index 1a360c2..b5b96d6 100644 --- a/lib/Utils.js +++ b/lib/Utils.js @@ -1,5 +1,6 @@ // Generated by CoffeeScript 1.10.0 -var Pattern, Utils; +var Pattern, Utils, + hasProp = {}.hasOwnProperty; Pattern = require('./Pattern'); @@ -68,7 +69,16 @@ Utils = (function() { }; Utils.isEmpty = function(value) { - return !value || value === '' || value === '0' || (value instanceof Array && value.length === 0); + var k; + return !value || value === '' || value === '0' || (value instanceof Array && value.length === 0) || (value instanceof Object && ((function() { + var results; + results = []; + for (k in value) { + if (!hasProp.call(value, k)) continue; + results.push(k); + } + return results; + })()).length === 0); }; Utils.subStrCount = function(string, subString, start, length) { |