fix: size filter does not respect Objects, fixes #385

This commit is contained in:
Harttle
2021-12-07 23:05:46 +08:00
committed by Harttle
parent e2ef236f68
commit 6c114267a5
2 changed files with 11 additions and 2 deletions
+2 -1
View File
@@ -104,6 +104,7 @@ function readLast (obj: Scope) {
}
function readSize (obj: Scope) {
if (obj.hasOwnProperty('size') || obj['size'] !== undefined) return obj['size']
if (isArray(obj) || isString(obj)) return obj.length
return obj['size']
if (typeof obj === 'object') return Object.keys(obj).length
}