* @param {IfCondition} condition
(condition, state)
| 94 | * @param {IfCondition} condition |
| 95 | */ |
| 96 | function evaluateCondition(condition, state) { |
| 97 | const left = PathHelper.get(state, condition.left); |
| 98 | const right = PathHelper.get(state, condition.right); |
| 99 | |
| 100 | let r; |
| 101 | if (condition.op === "eq") { |
| 102 | r = left === right; |
| 103 | } else { |
| 104 | r = left !== right; |
| 105 | } |
| 106 | |
| 107 | return r; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * @type { Record<BindingCallback["type"], (cb: any, state: Record<string, any>) => Promise<void>> } |