( expr: SimpleExpr, operator: LogicalOperator = "_&&_" )
| 64 | |
| 65 | // For simplify UI implementation, the "root" condition need to be a group. |
| 66 | export const wrapAsGroup = ( |
| 67 | expr: SimpleExpr, |
| 68 | operator: LogicalOperator = "_&&_" |
| 69 | ): ConditionGroupExpr => { |
| 70 | if (isConditionGroupExpr(expr)) return expr; |
| 71 | return { |
| 72 | type: ExprType.ConditionGroup, |
| 73 | operator, |
| 74 | args: [expr], |
| 75 | }; |
| 76 | }; |
| 77 | |
| 78 | // Convert common expr to simple expr |
| 79 | export const resolveCELExpr = (expr: CELExpr): SimpleExpr => { |
no test coverage detected