Fix #1482. Handle isEmpty filter correctly. (#1490)

This commit is contained in:
Chen-I Lim 2021-10-08 10:10:57 -07:00 committed by GitHub
parent d744e0af47
commit 3448551a0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,10 +59,10 @@ class CardFilter {
return (filter.values.find((cValue) => (Array.isArray(value) ? value.includes(cValue) : cValue === value)) === undefined)
}
case 'isEmpty': {
return value?.length <= 0
return (value || '').length <= 0
}
case 'isNotEmpty': {
return value?.length > 0
return (value || '').length > 0
}
default: {
Utils.assertFailure(`Invalid filter condition ${filter.condition}`)