From a5ba071f37736b019aa325fe88ad0f4e87eda22d Mon Sep 17 00:00:00 2001 From: ROSPARS Benoit <benoit.rospars@inria.fr> Date: Wed, 19 Jul 2023 09:55:33 +0000 Subject: [PATCH] Fix operands to supports boolean and more than 2 operands --- src/v2/rule.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v2/rule.ts b/src/v2/rule.ts index ac2fc03..fca5b7f 100644 --- a/src/v2/rule.ts +++ b/src/v2/rule.ts @@ -1,7 +1,7 @@ // Types to represents jsonlogic rules https://jsonlogic.com/ export type Operators = "var" | ">" | ">=" | "<" | "<=" | "===" | "!==" | "and" | "or"; -export type Operand = number | string | Rule; -export type Operands = [Operand, Operand?]; +export type Operand = number | string | boolean | Rule; +export type Operands = string | [Operand, Operand, ...Operand[]]; // minimum 2 operands or a value if operator is var export type Rule = { [key in Operators]?: Operands; -- GitLab