不要怂,就是干,撸起袖子干!

Commit ca2a11ae by Bene-Graham Committed by GitHub

fix(types): allow rangable to take a string tuple (#13486)

Co-authored-by: Sascha Depold <sdepold@users.noreply.github.com>
1 parent a4501866
Showing with 2 additions and 2 deletions
......@@ -131,7 +131,7 @@ export interface AllOperator {
[Op.all]: readonly (string | number | Date | Literal)[];
}
export type Rangable = readonly [number, number] | readonly [Date, Date] | Literal;
export type Rangable = readonly [number, number] | readonly [Date, Date] | readonly [string, string] | Literal;
/**
* Operators that can be used in WhereOptions
......
......@@ -227,7 +227,7 @@ MyModel.findAll({
[Op.lt]: 10, // id < 10
[Op.lte]: 10, // id <= 10
[Op.ne]: 20, // id != 20
[Op.between]: [6, 10] || [new Date(), new Date()], // BETWEEN 6 AND 10
[Op.between]: [6, 10] || [new Date(), new Date()] || ["2020-01-01", "2020-12-31"], // BETWEEN 6 AND 10
[Op.notBetween]: [11, 15], // NOT BETWEEN 11 AND 15
[Op.in]: [1, 2], // IN [1, 2]
[Op.notIn]: [1, 2], // NOT IN [1, 2]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!