1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-09-03 03:18:02 +00:00

Merge pull request #2048 from felixhayashi/fix/count

Replacing count with Object.keys
This commit is contained in:
Jeremy Ruston
2015-12-22 12:41:24 +00:00

View File

@@ -35,9 +35,7 @@ exports.trim = function(str) {
Return the number of keys in an object
*/
exports.count = function(object) {
var s = 0;
$tw.utils.each(object,function() {s++;});
return s;
return Object.keys(object || {}).length;
};
/*
@@ -645,4 +643,4 @@ exports.tagToCssSelector = function(tagName) {
};
})();
})();