Add lock=on/off to /gen and /genraw commands

This commit is contained in:
Cohee
2023-11-24 15:18:49 +02:00
parent 8e16f28827
commit dd17c2483f
3 changed files with 53 additions and 12 deletions

View File

@ -565,6 +565,24 @@ export function countOccurrences(string, character) {
return count;
}
/**
* Checks if a string is "true" value.
* @param {string} arg String to check
* @returns {boolean} True if the string is true, false otherwise.
*/
export function isTrueBoolean(arg) {
return ['on', 'true', '1'].includes(arg);
}
/**
* Checks if a string is "false" value.
* @param {string} arg String to check
* @returns {boolean} True if the string is false, false otherwise.
*/
export function isFalseBoolean(arg) {
return ['off', 'false', '0'].includes(arg);
}
/**
* Checks if a number is odd.
* @param {number} number The number to check.