| 523 | if (b === undefined) { | 523 | if (b === undefined) { |
| 524 | switch (rule) { | 524 | switch (rule) { |
| 525 | case undefined: | 525 | case undefined: |
| 526 | case 'not': | 526 | case 'not': { |
| 527 | const resultOnTruthy = rule !== 'not'; | 527 | const resultOnTruthy = rule !== 'not'; |
| 528 | if (isTrueBoolean(String(a))) return resultOnTruthy; | 528 | if (isTrueBoolean(String(a))) return resultOnTruthy; |
| 529 | if (isFalseBoolean(String(a))) return !resultOnTruthy; | 529 | if (isFalseBoolean(String(a))) return !resultOnTruthy; |
| 530 | return !!a ? resultOnTruthy : !resultOnTruthy; | 530 | return a ? resultOnTruthy : !resultOnTruthy; |
| | 531 | } |
| 531 | default: | 532 | default: |
| 532 | throw new Error(`Unknown boolean comparison rule for truthy check. If right operand is not provided, the rule must not provided or be 'not'. Provided: ${rule}`); | 533 | throw new Error(`Unknown boolean comparison rule for truthy check. If right operand is not provided, the rule must not provided or be 'not'. Provided: ${rule}`); |
| 533 | } | 534 | } |