Skip to content

Commit

Permalink
fix: πŸ› ensure we don't accept null from lt/lte filters
Browse files Browse the repository at this point in the history
βœ… Closes: #771
  • Loading branch information
morintd committed Jan 31, 2024
1 parent 3e74dd2 commit 34add0c
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 34add0c

Please sign in to comment.