| 544 | * @returns {boolean} True if the rule yields true, false otherwise | 544 | * @returns {boolean} True if the rule yields true, false otherwise |
| 545 | */ | 545 | */ |
| 546 | export function evalBoolean(rule, a, b) { | 546 | export function evalBoolean(rule, a, b) { |
| | 547 | if (a === undefined) { |
| | 548 | throw new Error('Left operand is not provided'); |
| | 549 | } |
| | 550 | |
| 547 | // If right-hand side was not provided, whe just check if the left side is truthy | 551 | // If right-hand side was not provided, whe just check if the left side is truthy |
| 548 | if (b === undefined) { | 552 | if (b === undefined) { |
| 549 | switch (rule) { | 553 | switch (rule) { |