mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 18:14:46 +00:00
18 lines
491 B
TypeScript
18 lines
491 B
TypeScript
/** List normalized configured account ids from a raw channel account record map. */
|
|
export function listConfiguredAccountIds(params: {
|
|
accounts: Record<string, unknown> | undefined;
|
|
normalizeAccountId: (accountId: string) => string;
|
|
}): string[] {
|
|
if (!params.accounts) {
|
|
return [];
|
|
}
|
|
const ids = new Set<string>();
|
|
for (const key of Object.keys(params.accounts)) {
|
|
if (!key) {
|
|
continue;
|
|
}
|
|
ids.add(params.normalizeAccountId(key));
|
|
}
|
|
return [...ids];
|
|
}
|