mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Throw when left operand not provided
This commit is contained in:
@ -544,6 +544,10 @@ export function parseBooleanOperands(args) {
|
||||
* @returns {boolean} True if the rule yields true, false otherwise
|
||||
*/
|
||||
export function evalBoolean(rule, a, b) {
|
||||
if (a === undefined) {
|
||||
throw new Error('Left operand is not provided');
|
||||
}
|
||||
|
||||
// If right-hand side was not provided, whe just check if the left side is truthy
|
||||
if (b === undefined) {
|
||||
switch (rule) {
|
||||
|
Reference in New Issue
Block a user