mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix lint issues
This commit is contained in:
@ -523,11 +523,12 @@ export function evalBoolean(rule, a, b) {
|
|||||||
if (b === undefined) {
|
if (b === undefined) {
|
||||||
switch (rule) {
|
switch (rule) {
|
||||||
case undefined:
|
case undefined:
|
||||||
case 'not':
|
case 'not': {
|
||||||
const resultOnTruthy = rule !== 'not';
|
const resultOnTruthy = rule !== 'not';
|
||||||
if (isTrueBoolean(String(a))) return resultOnTruthy;
|
if (isTrueBoolean(String(a))) return resultOnTruthy;
|
||||||
if (isFalseBoolean(String(a))) return !resultOnTruthy;
|
if (isFalseBoolean(String(a))) return !resultOnTruthy;
|
||||||
return !!a ? resultOnTruthy : !resultOnTruthy;
|
return a ? resultOnTruthy : !resultOnTruthy;
|
||||||
|
}
|
||||||
default:
|
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}`);
|
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}`);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user