Skip to content

Commit

Permalink
fix(model.d): accept [Op.is] in where (broken in TypeScript 4.4) (#13499
Browse files Browse the repository at this point in the history
)

* fix(model.d): accept `[Op.is]` in where

* fix(model.d): test `[Op.is]` in where

Co-authored-by: Sascha Depold <sdepold@users.noreply.github.com>
Co-authored-by: Constantin Metz <58604248+Keimeno@users.noreply.github.com>
  • Loading branch information
3 people committed Oct 10, 2021
1 parent 69d899e commit d685a9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions types/lib/model.d.ts
Expand Up @@ -161,6 +161,9 @@ export interface WhereOperators {
/** Example: `[Op.not]: true,` becomes `IS NOT TRUE` */
[Op.not]?: null | boolean | string | number | Literal | WhereOperators;

/** Example: `[Op.is]: null,` becomes `IS NULL` */
[Op.is]?: null;

/** Example: `[Op.between]: [6, 10],` becomes `BETWEEN 6 AND 10` */
[Op.between]?: Rangable;

Expand Down
1 change: 1 addition & 0 deletions types/test/where.ts
Expand Up @@ -50,6 +50,7 @@ expectTypeOf({
[Op.lte]: 10, // <= 10
[Op.ne]: 20, // != 20
[Op.not]: true, // IS NOT TRUE
[Op.is]: null, // IS NULL
[Op.between]: [6, 10], // BETWEEN 6 AND 10
[Op.notBetween]: [11, 15], // NOT BETWEEN 11 AND 15
[Op.in]: [1, 2], // IN [1, 2]
Expand Down

0 comments on commit d685a9a

Please sign in to comment.