style: apply oxfmt
This commit is contained in:
@@ -10,7 +10,10 @@ export function parseAllowlistEntries(raw: string): string[] {
|
||||
}
|
||||
|
||||
export function formatAllowlistEntries(entries: string[]): string {
|
||||
return entries.map((entry) => entry.trim()).filter(Boolean).join(", ");
|
||||
return entries
|
||||
.map((entry) => entry.trim())
|
||||
.filter(Boolean)
|
||||
.join(", ");
|
||||
}
|
||||
|
||||
export async function promptChannelAccessPolicy(params: {
|
||||
|
||||
@@ -310,13 +310,13 @@ export const discordOnboardingAdapter: ChannelOnboardingAdapter = {
|
||||
token: accountWithTokens.token,
|
||||
entries: accessConfig.entries,
|
||||
});
|
||||
const resolvedChannels = resolved.filter(
|
||||
(entry) => entry.resolved && entry.channelId,
|
||||
);
|
||||
const resolvedChannels = resolved.filter((entry) => entry.resolved && entry.channelId);
|
||||
const resolvedGuilds = resolved.filter(
|
||||
(entry) => entry.resolved && entry.guildId && !entry.channelId,
|
||||
);
|
||||
const unresolved = resolved.filter((entry) => !entry.resolved).map((entry) => entry.input);
|
||||
const unresolved = resolved
|
||||
.filter((entry) => !entry.resolved)
|
||||
.map((entry) => entry.input);
|
||||
if (resolvedChannels.length > 0 || resolvedGuilds.length > 0 || unresolved.length > 0) {
|
||||
const summary: string[] = [];
|
||||
if (resolvedChannels.length > 0) {
|
||||
|
||||
@@ -166,9 +166,7 @@ function setSlackChannelAllowlist(
|
||||
accountId: string,
|
||||
channelKeys: string[],
|
||||
): ClawdbotConfig {
|
||||
const channels = Object.fromEntries(
|
||||
channelKeys.map((key) => [key, { allow: true }]),
|
||||
);
|
||||
const channels = Object.fromEntries(channelKeys.map((key) => [key, { allow: true }]));
|
||||
if (accountId === DEFAULT_ACCOUNT_ID) {
|
||||
return {
|
||||
...cfg,
|
||||
@@ -396,16 +394,11 @@ export const slackOnboardingAdapter: ChannelOnboardingAdapter = {
|
||||
const unresolved = resolved
|
||||
.filter((entry) => !entry.resolved)
|
||||
.map((entry) => entry.input);
|
||||
keys = [
|
||||
...resolvedKeys,
|
||||
...unresolved.map((entry) => entry.trim()).filter(Boolean),
|
||||
];
|
||||
keys = [...resolvedKeys, ...unresolved.map((entry) => entry.trim()).filter(Boolean)];
|
||||
if (resolvedKeys.length > 0 || unresolved.length > 0) {
|
||||
await prompter.note(
|
||||
[
|
||||
resolvedKeys.length > 0
|
||||
? `Resolved: ${resolvedKeys.join(", ")}`
|
||||
: undefined,
|
||||
resolvedKeys.length > 0 ? `Resolved: ${resolvedKeys.join(", ")}` : undefined,
|
||||
unresolved.length > 0
|
||||
? `Unresolved (kept as typed): ${unresolved.join(", ")}`
|
||||
: undefined,
|
||||
|
||||
@@ -17,8 +17,10 @@ export function formatMatchMetadata(params: {
|
||||
? String(params.matchKey)
|
||||
: undefined;
|
||||
const matchSource = asString(params.matchSource);
|
||||
const parts = [matchKey ? `matchKey=${matchKey}` : null, matchSource ? `matchSource=${matchSource}` : null]
|
||||
.filter((entry): entry is string => Boolean(entry));
|
||||
const parts = [
|
||||
matchKey ? `matchKey=${matchKey}` : null,
|
||||
matchSource ? `matchSource=${matchSource}` : null,
|
||||
].filter((entry): entry is string => Boolean(entry));
|
||||
return parts.length > 0 ? parts.join(" ") : undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user