mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-17 12:40:40 +01:00
Fix boolean comparison
This commit is contained in:
parent
a2f293b6af
commit
690c058a46
@ -572,7 +572,7 @@ export function countOccurrences(string, character) {
|
||||
* @returns {boolean} True if the string is true, false otherwise.
|
||||
*/
|
||||
export function isTrueBoolean(arg) {
|
||||
return ['on', 'true', '1'].includes(arg.trim().toLowerCase());
|
||||
return ['on', 'true', '1'].includes(arg?.trim()?.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -581,7 +581,7 @@ export function isTrueBoolean(arg) {
|
||||
* @returns {boolean} True if the string is false, false otherwise.
|
||||
*/
|
||||
export function isFalseBoolean(arg) {
|
||||
return ['off', 'false', '0'].includes(arg.trim().toLowerCase());
|
||||
return ['off', 'false', '0'].includes(arg?.trim()?.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user