mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Improve number type conversion in getConfigValue to handle NaN cases
This commit is contained in:
@ -76,7 +76,7 @@ export function getConfigValue(key, defaultValue = null, typeConverter = null) {
|
||||
const value = _getValue();
|
||||
switch (typeConverter) {
|
||||
case 'number':
|
||||
return Number(value);
|
||||
return isNaN(parseFloat(value)) ? defaultValue : parseFloat(value);
|
||||
case 'boolean':
|
||||
return toBoolean(value);
|
||||
default:
|
||||
|
Reference in New Issue
Block a user