Down to 2 failures.

This commit is contained in:
Sam Rose 2024-06-13 17:05:02 +01:00
parent c01c2c7cc3
commit f909cdee43
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -285,7 +285,10 @@ export const runQuery = (
) =>
(doc: Record<string, any>) => {
for (const [key, testValue] of Object.entries(query[type] || {})) {
if (!test(deepGet(doc, removeKeyNumbering(key)), testValue)) {
const result = test(deepGet(doc, removeKeyNumbering(key)), testValue)
if (query.allOr && result) {
return true
} else if (!query.allOr && !result) {
return false
}
}