mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
fix: size filter does not respect Objects, fixes #385
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user