diff --git a/public/scripts/variables.js b/public/scripts/variables.js index 9edc0940b..443bbbd30 100644 --- a/public/scripts/variables.js +++ b/public/scripts/variables.js @@ -523,11 +523,12 @@ export function evalBoolean(rule, a, b) { if (b === undefined) { switch (rule) { case undefined: - case 'not': + case 'not': { const resultOnTruthy = rule !== 'not'; if (isTrueBoolean(String(a))) return resultOnTruthy; if (isFalseBoolean(String(a))) return !resultOnTruthy; - return !!a ? resultOnTruthy : !resultOnTruthy; + return a ? resultOnTruthy : !resultOnTruthy; + } default: 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}`); }