mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-15 10:51:27 +00:00
17 lines
448 B
TypeScript
17 lines
448 B
TypeScript
export function normalizeMessageProvider(
|
|
raw?: string | null,
|
|
): string | undefined {
|
|
const normalized = raw?.trim().toLowerCase();
|
|
if (!normalized) return undefined;
|
|
return normalized === "imsg" ? "imessage" : normalized;
|
|
}
|
|
|
|
export function resolveMessageProvider(
|
|
primary?: string | null,
|
|
fallback?: string | null,
|
|
): string | undefined {
|
|
return (
|
|
normalizeMessageProvider(primary) ?? normalizeMessageProvider(fallback)
|
|
);
|
|
}
|