File tree Expand file tree Collapse file tree 1 file changed +35
-27
lines changed Expand file tree Collapse file tree 1 file changed +35
-27
lines changed Original file line number Diff line number Diff line change @@ -5,36 +5,44 @@ class Operators {
5
5
return ! ! ( options && options . Sequelize && options . Sequelize . Op ) ;
6
6
}
7
7
8
+ _setupNewSequelizeOp ( options ) {
9
+ const { Op } = options . Sequelize ;
10
+ this . AND = Op . and ;
11
+ this . CONTAINS = Op . contains ;
12
+ this . EQ = Op . eq ;
13
+ this . GT = Op . gt ;
14
+ this . GTE = Op . gte ;
15
+ this . IN = Op . in ;
16
+ this . LIKE = Op . like ;
17
+ this . LT = Op . lt ;
18
+ this . LTE = Op . lte ;
19
+ this . NE = Op . ne ;
20
+ this . NOT = Op . not ;
21
+ this . NOT_LIKE = Op . notLike ;
22
+ this . OR = Op . or ;
23
+ }
24
+
25
+ _setupOldSequelizeOp ( ) {
26
+ this . AND = '$and' ;
27
+ this . CONTAINS = '$contains' ;
28
+ this . EQ = '$eq' ;
29
+ this . GT = '$gt' ;
30
+ this . GTE = '$gte' ;
31
+ this . IN = '$in' ;
32
+ this . LIKE = '$like' ;
33
+ this . LT = '$lt' ;
34
+ this . LTE = '$lte' ;
35
+ this . NE = '$ne' ;
36
+ this . NOT = '$not' ;
37
+ this . NOT_LIKE = '$notLike' ;
38
+ this . OR = '$or' ;
39
+ }
40
+
8
41
constructor ( options ) {
9
42
if ( Operators . _isNewSequelizeOp ( options ) ) {
10
- const { Op } = options . Sequelize ;
11
- this . AND = Op . and ;
12
- this . CONTAINS = Op . contains ;
13
- this . EQ = Op . eq ;
14
- this . GT = Op . gt ;
15
- this . GTE = Op . gte ;
16
- this . IN = Op . in ;
17
- this . LIKE = Op . like ;
18
- this . LT = Op . lt ;
19
- this . LTE = Op . lte ;
20
- this . NE = Op . ne ;
21
- this . NOT = Op . not ;
22
- this . NOT_LIKE = Op . notLike ;
23
- this . OR = Op . or ;
43
+ this . _setupNewSequelizeOp ( options ) ;
24
44
} else {
25
- this . AND = '$and' ;
26
- this . CONTAINS = '$contains' ;
27
- this . EQ = '$eq' ;
28
- this . GT = '$gt' ;
29
- this . GTE = '$gte' ;
30
- this . IN = '$in' ;
31
- this . LIKE = '$like' ;
32
- this . LT = '$lt' ;
33
- this . LTE = '$lte' ;
34
- this . NE = '$ne' ;
35
- this . NOT = '$not' ;
36
- this . NOT_LIKE = '$notLike' ;
37
- this . OR = '$or' ;
45
+ this . _setupOldSequelizeOp ( ) ;
38
46
}
39
47
40
48
Operators . _instance = this ;
You can’t perform that action at this time.
0 commit comments