chore: Enable some "perf" lint rules.

This commit is contained in:
cpojer
2026-01-31 15:58:24 +09:00
parent f99e3ddd6d
commit 7a9ddcd590
8 changed files with 20 additions and 13 deletions

View File

@@ -331,13 +331,13 @@ export function resolveGroupDmAllow(params: {
}) {
const { channels, channelId, channelName, channelSlug } = params;
if (!channels || channels.length === 0) return true;
const allowList = channels.map((entry) => normalizeDiscordSlug(String(entry)));
const allowList = new Set(channels.map((entry) => normalizeDiscordSlug(String(entry))));
const candidates = [
normalizeDiscordSlug(channelId),
channelSlug,
channelName ? normalizeDiscordSlug(channelName) : "",
].filter(Boolean);
return allowList.includes("*") || candidates.some((candidate) => allowList.includes(candidate));
return allowList.has("*") || candidates.some((candidate) => allowList.has(candidate));
}
export function shouldEmitDiscordReactionNotification(params: {