style: apply oxfmt

This commit is contained in:
Peter Steinberger
2026-01-18 02:19:35 +00:00
parent b659db0a5b
commit 0c93b9b7bb
21 changed files with 87 additions and 89 deletions

View File

@@ -80,7 +80,9 @@ export async function listSlackDirectoryPeersLive(
const name = member.profile?.display_name || member.profile?.real_name || member.real_name;
const handle = member.name;
const email = member.profile?.email;
const candidates = [name, handle, email].map((item) => item?.trim().toLowerCase()).filter(Boolean);
const candidates = [name, handle, email]
.map((item) => item?.trim().toLowerCase())
.filter(Boolean);
if (!query) return true;
return candidates.some((candidate) => candidate?.includes(query));
});

View File

@@ -187,9 +187,7 @@ export async function monitorSlackProvider(opts: MonitorSlackOpts = {}) {
unresolved.push(entry.input);
continue;
}
mapping.push(
`${entry.input}${entry.id}${entry.archived ? " (archived)" : ""}`,
);
mapping.push(`${entry.input}${entry.id}${entry.archived ? " (archived)" : ""}`);
const existing = nextChannels[entry.id] ?? {};
nextChannels[entry.id] = { ...source, ...existing };
}
@@ -276,7 +274,9 @@ export async function monitorSlackProvider(opts: MonitorSlackOpts = {}) {
ctx.channelsConfig = nextChannels;
summarizeMapping("slack channel users", mapping, unresolved, runtime);
} catch (err) {
runtime.log?.(`slack channel user resolve failed; using config entries. ${String(err)}`);
runtime.log?.(
`slack channel user resolve failed; using config entries. ${String(err)}`,
);
}
}
}

View File

@@ -88,11 +88,7 @@ function scoreSlackUser(user: SlackUserLookup, match: { name?: string; email?: s
if (match.email && user.email === match.email) score += 5;
if (match.name) {
const target = match.name.toLowerCase();
const candidates = [
user.name,
user.displayName,
user.realName,
]
const candidates = [user.name, user.displayName, user.realName]
.map((value) => value?.toLowerCase())
.filter(Boolean) as string[];
if (candidates.some((value) => value === target)) score += 2;
@@ -147,11 +143,7 @@ export async function resolveSlackUserAllowlist(params: {
if (parsed.name) {
const target = parsed.name.toLowerCase();
const matches = users.filter((user) => {
const candidates = [
user.name,
user.displayName,
user.realName,
]
const candidates = [user.name, user.displayName, user.realName]
.map((value) => value?.toLowerCase())
.filter(Boolean) as string[];
return candidates.includes(target);