Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Commit 423fac1

Browse files
committed
fix(filter): Fixes $not filters.
1 parent 08ffad8 commit 423fac1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/tests/utils/filterTest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ export default (opts: Opts) => {
7474

7575
it('should filter correctly when using $not operator', async () => {
7676
await createTestEntities();
77-
await opts.assertFirstEntityFilter({ stringProp: { $not: 'b' } });
77+
await opts.assertFirstEntityFilter({ stringProp: { $not: { $eq: 'b' } } });
7878
});
7979
};

src/types/Filter.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ export type PropFilter<Prop> = (
99
LesserFilter<Prop> |
1010
InFilter<Prop> |
1111
EqualityFilter<Prop> |
12-
NotFilter<Prop> |
13-
Prop
12+
NotFilter<Prop>
1413
);
1514

1615
export type EntityFilter<Entity> = {
17-
readonly [P in keyof Entity]?: PropFilter<Entity[P]>;
16+
readonly [P in keyof Entity]?: Entity[P] | PropFilter<Entity[P]>;
1817
};
1918

2019
export interface AndFilter<Entity> {

0 commit comments

Comments
 (0)