Fix lint issues

This commit is contained in:
Wolfsblvt 2024-09-25 20:44:28 +02:00
parent dadfc4db98
commit 23286d186b

View File

@ -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}`);
}