mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-28 15:08:46 +00:00
Merge pull request #2048 from felixhayashi/fix/count
Replacing count with Object.keys
This commit is contained in:
commit
fa1814d0f4
@ -35,9 +35,7 @@ exports.trim = function(str) {
|
|||||||
Return the number of keys in an object
|
Return the number of keys in an object
|
||||||
*/
|
*/
|
||||||
exports.count = function(object) {
|
exports.count = function(object) {
|
||||||
var s = 0;
|
return Object.keys(object || {}).length;
|
||||||
$tw.utils.each(object,function() {s++;});
|
|
||||||
return s;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user