Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a5ba071f authored by ROSPARS Benoit's avatar ROSPARS Benoit
Browse files

Fix operands to supports boolean and more than 2 operands

parent f9831623
Branches
No related tags found
No related merge requests found
// Types to represents jsonlogic rules https://jsonlogic.com/ // Types to represents jsonlogic rules https://jsonlogic.com/
export type Operators = "var" | ">" | ">=" | "<" | "<=" | "===" | "!==" | "and" | "or"; export type Operators = "var" | ">" | ">=" | "<" | "<=" | "===" | "!==" | "and" | "or";
export type Operand = number | string | Rule; export type Operand = number | string | boolean | Rule;
export type Operands = [Operand, Operand?]; export type Operands = string | [Operand, Operand, ...Operand[]]; // minimum 2 operands or a value if operator is var
export type Rule = { export type Rule = {
[key in Operators]?: Operands; [key in Operators]?: Operands;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment