mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add type checking and JSDoc comments to some utils
This commit is contained in:
@ -25,13 +25,12 @@ function createStatBlock(statName, statValue) {
|
||||
* @returns {number} - The stat value if it is a number, otherwise 0.
|
||||
*/
|
||||
function verifyStatValue(stat) {
|
||||
return isNaN(stat) ? 0 : stat;
|
||||
return isNaN(Number(stat)) ? 0 : Number(stat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates total stats from character statistics.
|
||||
*
|
||||
* @param {Object} charStats - Object containing character statistics.
|
||||
* @returns {Object} - Object containing total statistics.
|
||||
*/
|
||||
function calculateTotalStats() {
|
||||
|
Reference in New Issue
Block a user