Fix type errors

14212fb76192dd540944a0aba2b48d53d4ad6aa8

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

3 files changed, +7 -3Ignore whitespace
public/scripts/i18n.js+1 -1
@@ -67,7 +67,7 @@ const observer = new MutationObserver(mutations => {
6767 *
6868 * @example
6969 * ```js
7070 * toastr.warnwarning(t`Tag ${tagName} not found.`);
7171 * ```
7272 * Should be translated in the translation files as:
7373 * ```
public/scripts/slash-commands.js+5 -2
@@ -777,7 +777,7 @@ export function initDefaultSlashCommands() {
777777 const isId = !isNaN(parseInt(arg));
778778 const groupMember = findGroupMemberId(arg, true);
779779 if (!groupMember) {
780780 toastr.warnwarning(`No group member found using ${isId ? 'id' : 'string'} ${arg}`);
781781 return '';
782782 }
783783 return groupMember[field];
@@ -2127,6 +2127,9 @@ export function initDefaultSlashCommands() {
21272127 if (!pattern) {
21282128 throw new Error('Argument of \'pattern=\' cannot be empty');
21292129 }
2130+ text = text.toString();
2131+ pattern = pattern.toString();
2132+ replacer = replacer.toString();
21302133 switch (mode) {
21312134 case 'literal':
21322135 return text.replaceAll(pattern, replacer);
@@ -2914,7 +2917,7 @@ async function runCallback(args, name) {
29142917 */
29152918function abortCallback({ _abortController, quiet }, reason) {
29162919 if (quiet instanceof SlashCommandClosure) throw new Error('argument \'quiet\' cannot be a closure for command /abort');
29172920 _abortController.abort((reason ?? '').toString().length == 0 ? '/abort command executed' : reason, !isFalseBoolean(quiet?.toString() ?? 'true'));
29182921 return '';
29192922}
29202923
public/scripts/world-info.js+1 -0
@@ -2568,6 +2568,7 @@ function enableKeysInputHelper({ template, entry, entryPropName, originalDataVal
25682568 ajax: dynamicSelect2DataViaAjax(() => worldEntryKeyOptionsCache),
25692569 tags: true,
25702570 tokenSeparators: [','],
2571+ // @ts-ignore
25712572 tokenizer: customTokenizer,
25722573 placeholder: input.attr('placeholder'),
25732574 templateResult: item => templateStyling(item, { searchStyle: true }),