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