Return type casts where they were

861c502e4472be977f608adb1b0f850c312143ef

Cohee <18619528+Cohee1207@users.noreply.github.com>

5 files changed, +11 -11Showing whitespace changes
src/endpoints/backends/text-completions.js+2 -2
@@ -372,8 +372,8 @@ router.post('/generate', jsonParser, async function (request, response) {
372 }372 }
373373
374 if (request.body.api_type === TEXTGEN_TYPES.OLLAMA) {374 if (request.body.api_type === TEXTGEN_TYPES.OLLAMA) {
375 const keepAlive = getConfigValue('ollama.keepAlive', -1, 'number');375 const keepAlive = Number(getConfigValue('ollama.keepAlive', -1, 'number'));
376 const numBatch = getConfigValue('ollama.batchSize', -1, 'number');376 const numBatch = Number(getConfigValue('ollama.batchSize', -1, 'number'));
377 if (numBatch > 0) {377 if (numBatch > 0) {
378 request.body['num_batch'] = numBatch;378 request.body['num_batch'] = numBatch;
379 }379 }
src/endpoints/characters.js+1 -1
@@ -24,7 +24,7 @@ import { importRisuSprites } from './sprites.js';
24const defaultAvatarPath = './public/img/ai4.png';24const defaultAvatarPath = './public/img/ai4.png';
2525
26// KV-store for parsed character data26// KV-store for parsed character data
27const cacheCapacity = getConfigValue('cardsCacheCapacity', 100, 'number'); // MB27const cacheCapacity = Number(getConfigValue('cardsCacheCapacity', 100, 'number')); // MB
28// With 100 MB limit it would take roughly 3000 characters to reach this limit28// With 100 MB limit it would take roughly 3000 characters to reach this limit
29const characterDataCache = new MemoryLimitedMap(1024 * 1024 * cacheCapacity);29const characterDataCache = new MemoryLimitedMap(1024 * 1024 * cacheCapacity);
30// Some Android devices require tighter memory management30// Some Android devices require tighter memory management
src/endpoints/chats.js+3 -3
@@ -19,9 +19,9 @@ import {
19 formatBytes,19 formatBytes,
20} from '../util.js';20} from '../util.js';
2121
22const isBackupEnabled = getConfigValue('backups.chat.enabled', true, 'boolean');22const isBackupEnabled = !!getConfigValue('backups.chat.enabled', true, 'boolean');
23const maxTotalChatBackups = getConfigValue('backups.chat.maxTotalBackups', -1, 'number');23const maxTotalChatBackups = Number(getConfigValue('backups.chat.maxTotalBackups', -1, 'number'));
24const throttleInterval = getConfigValue('backups.chat.throttleInterval', 10_000, 'number');24const throttleInterval = Number(getConfigValue('backups.chat.throttleInterval', 10_000, 'number'));
2525
26/**26/**
27 * Saves a chat to the backups directory.27 * Saves a chat to the backups directory.
src/endpoints/settings.js+3 -3
@@ -11,9 +11,9 @@ import { jsonParser } from '../express-common.js';
11import { getAllUserHandles, getUserDirectories } from '../users.js';11import { getAllUserHandles, getUserDirectories } from '../users.js';
12import { getFileNameValidationFunction } from '../middleware/validateFileName.js';12import { getFileNameValidationFunction } from '../middleware/validateFileName.js';
1313
14const ENABLE_EXTENSIONS = getConfigValue('extensions.enabled', true, 'boolean');14const ENABLE_EXTENSIONS = !!getConfigValue('extensions.enabled', true, 'boolean');
15const ENABLE_EXTENSIONS_AUTO_UPDATE = getConfigValue('extensions.autoUpdate', true, 'boolean');15const ENABLE_EXTENSIONS_AUTO_UPDATE = !!getConfigValue('extensions.autoUpdate', true, 'boolean');
16const ENABLE_ACCOUNTS = getConfigValue('enableUserAccounts', false, 'boolean');16const ENABLE_ACCOUNTS = !!getConfigValue('enableUserAccounts', false, 'boolean');
1717
18// 10 minutes18// 10 minutes
19const AUTOSAVE_INTERVAL = 10 * 60 * 1000;19const AUTOSAVE_INTERVAL = 10 * 60 * 1000;
src/plugin-loader.js+2 -2
@@ -7,8 +7,8 @@ import { default as git, CheckRepoActions } from 'simple-git';
7import { sync as commandExistsSync } from 'command-exists';7import { sync as commandExistsSync } from 'command-exists';
8import { getConfigValue, color } from './util.js';8import { getConfigValue, color } from './util.js';
99
10const enableServerPlugins = getConfigValue('enableServerPlugins', false, 'boolean');10const enableServerPlugins = !!getConfigValue('enableServerPlugins', false, 'boolean');
11const enableServerPluginsAutoUpdate = getConfigValue('enableServerPluginsAutoUpdate', true, 'boolean');11const enableServerPluginsAutoUpdate = !!getConfigValue('enableServerPluginsAutoUpdate', true, 'boolean');
1212
13/**13/**
14 * Map of loaded plugins.14 * Map of loaded plugins.