This repository was archived by the owner on Jun 22, 2021. It is now read-only.
File tree 2 files changed +7
-9
lines changed
2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,6 @@ export default (opts: Opts) => {
74
74
75
75
it ( 'should filter correctly when using $not operator' , async ( ) => {
76
76
await createTestEntities ( ) ;
77
- await opts . assertFirstEntityFilter ( { $not : { stringProp : 'b' } } ) ;
77
+ await opts . assertFirstEntityFilter ( { stringProp : { $not : 'b' } } ) ;
78
78
} ) ;
79
79
} ;
Original file line number Diff line number Diff line change @@ -2,16 +2,19 @@ export type GreaterFilter<Prop> = { readonly $gt: Prop } | { readonly $gte: Prop
2
2
export type LesserFilter < Prop > = { readonly $lt : Prop } | { readonly $lte : Prop } ;
3
3
export type InFilter < Prop > = { readonly $in : Prop [ ] } | { readonly $nin : Prop [ ] } ;
4
4
export type EqualityFilter < Prop > = { readonly $eq : Prop } | { readonly $ne : Prop } ;
5
+ export interface NotFilter < Prop > { readonly $not : PropFilter < Prop > ; }
5
6
6
7
export type PropFilter < Prop > = (
7
8
GreaterFilter < Prop > |
8
9
LesserFilter < Prop > |
9
10
InFilter < Prop > |
10
- EqualityFilter < Prop >
11
+ EqualityFilter < Prop > |
12
+ NotFilter < Prop > |
13
+ Prop
11
14
) ;
12
15
13
16
export type EntityFilter < Entity > = {
14
- readonly [ P in keyof Entity ] ?: Entity [ P ] | PropFilter < Entity [ P ] > ;
17
+ readonly [ P in keyof Entity ] ?: PropFilter < Entity [ P ] > ;
15
18
} ;
16
19
17
20
export interface AndFilter < Entity > {
@@ -22,15 +25,10 @@ export interface OrFilter<Entity> {
22
25
readonly $or : Filter < Entity > [ ] ;
23
26
}
24
27
25
- export interface NotFilter < Entity > {
26
- readonly $not : Filter < Entity > ;
27
- }
28
-
29
28
export type Filter < Entity > = (
30
29
EntityFilter < Entity > |
31
30
AndFilter < Entity > |
32
- OrFilter < Entity > |
33
- NotFilter < Entity >
31
+ OrFilter < Entity >
34
32
) ;
35
33
36
34
export default Filter ;
You can’t perform that action at this time.
0 commit comments