mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-03 12:47:35 +01:00
Throw when left operand not provided
This commit is contained in:
parent
7abb1751b1
commit
8c87a24e5d
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user