Skip to content

Commit

Permalink
Merge pull request #775 from morintd/fix/lt-lte-null
Browse files Browse the repository at this point in the history
fix: 🐛 ensure we don't accept null from lt/lte filters
  • Loading branch information
morintd authored Jan 31, 2024
2 parents ff329f1 + 34add0c commit d80de8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/operations/find/match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ export const matchMultiple = (item: Item, where: FindWhereArgs, current: Delegat
match = val >= formatValueWithMode(filter.gte, filter, info)!;
}
if ('lt' in filter && match) {
match = val < formatValueWithMode(filter.lt, filter, info)!;
match = val !== null && val < formatValueWithMode(filter.lt, filter, info)!;
}
if ('lte' in filter && match) {
match = val <= formatValueWithMode(filter.lte, filter, info)!;
match = val !== null && val <= formatValueWithMode(filter.lte, filter, info)!;
}
if ('in' in filter && match) {
match = (filter.in as any[]).map((inEntry) => formatValueWithMode(inEntry, filter, info)).includes(val);
Expand Down

0 comments on commit d80de8e

Please sign in to comment.