1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 02:19:55 +00:00

Replacing count's function body with Object.keys

see #2046
This commit is contained in:
Felix Hayashi 2015-11-03 23:47:47 +01:00
parent 41287d7859
commit f217451fc5

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) {
};
})();
})();