From e5dfcf6f64dff49b53ddddffbd5be8619c2b91a4 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Sat, 26 Jul 2025 16:51:57 -0400 Subject: [PATCH] fix SkPatternTest --- packages/frontend/src/utility/check-word-mute.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/frontend/src/utility/check-word-mute.ts b/packages/frontend/src/utility/check-word-mute.ts index 32b1064162..0bd888fb20 100644 --- a/packages/frontend/src/utility/check-word-mute.ts +++ b/packages/frontend/src/utility/check-word-mute.ts @@ -159,6 +159,14 @@ function isSensitiveMuted(note: Misskey.entities.Note): boolean { } export function getMutedWords(mutedWords: (string | string[])[], inputs: Iterable): string[] { + // Fixup: string is assignable to Iterable, but doesn't work below. + // As a workaround, we can special-case it to "upgrade" plain strings into arrays instead. + // We also need a noinspection tag, since JetBrains IDEs don't understand this behavior either. + // noinspection SuspiciousTypeOfGuard + if (typeof(inputs) === 'string') { + inputs = [inputs]; + } + // Parse mutes const { regexMutes, patternMutes } = parseMutes(mutedWords);