Fix type errors
| @@ -67,7 +67,7 @@ const observer = new MutationObserver(mutations => { | ||
| 67 | 67 | * |
| 68 | 68 | * @example |
| 69 | 69 | * ```js |
| 70 | 70 | * toastr.warnwarning(t`Tag ${tagName} not found.`); |
| 71 | 71 | * ``` |
| 72 | 72 | * Should be translated in the translation files as: |
| 73 | 73 | * ``` |
| @@ -777,7 +777,7 @@ export function initDefaultSlashCommands() { | ||
| 777 | 777 | const isId = !isNaN(parseInt(arg)); |
| 778 | 778 | const groupMember = findGroupMemberId(arg, true); |
| 779 | 779 | if (!groupMember) { |
| 780 | 780 | toastr.warnwarning(`No group member found using ${isId ? 'id' : 'string'} ${arg}`); |
| 781 | 781 | return ''; |
| 782 | 782 | } |
| 783 | 783 | return groupMember[field]; |
| @@ -2127,6 +2127,9 @@ export function initDefaultSlashCommands() { | ||
| 2127 | 2127 | if (!pattern) { |
| 2128 | 2128 | throw new Error('Argument of \'pattern=\' cannot be empty'); |
| 2129 | 2129 | } |
| 2130 | + text = text.toString(); | |
| 2131 | + pattern = pattern.toString(); | |
| 2132 | + replacer = replacer.toString(); | |
| 2130 | 2133 | switch (mode) { |
| 2131 | 2134 | case 'literal': |
| 2132 | 2135 | return text.replaceAll(pattern, replacer); |
| @@ -2914,7 +2917,7 @@ async function runCallback(args, name) { | ||
| 2914 | 2917 | */ |
| 2915 | 2918 | function abortCallback({ _abortController, quiet }, reason) { |
| 2916 | 2919 | if (quiet instanceof SlashCommandClosure) throw new Error('argument \'quiet\' cannot be a closure for command /abort'); |
| 2917 | 2920 | _abortController.abort((reason ?? '').toString().length == 0 ? '/abort command executed' : reason, !isFalseBoolean(quiet?.toString() ?? 'true')); |
| 2918 | 2921 | return ''; |
| 2919 | 2922 | } |
| 2920 | 2923 | |
| @@ -2568,6 +2568,7 @@ function enableKeysInputHelper({ template, entry, entryPropName, originalDataVal | ||
| 2568 | 2568 | ajax: dynamicSelect2DataViaAjax(() => worldEntryKeyOptionsCache), |
| 2569 | 2569 | tags: true, |
| 2570 | 2570 | tokenSeparators: [','], |
| 2571 | + // @ts-ignore | |
| 2571 | 2572 | tokenizer: customTokenizer, |
| 2572 | 2573 | placeholder: input.attr('placeholder'), |
| 2573 | 2574 | templateResult: item => templateStyling(item, { searchStyle: true }), |