mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 14:24:30 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -2,9 +2,17 @@ export type NormalizedChatType = "direct" | "group" | "channel";
|
||||
|
||||
export function normalizeChatType(raw?: string): NormalizedChatType | undefined {
|
||||
const value = raw?.trim().toLowerCase();
|
||||
if (!value) return undefined;
|
||||
if (value === "direct" || value === "dm") return "direct";
|
||||
if (value === "group") return "group";
|
||||
if (value === "channel") return "channel";
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === "direct" || value === "dm") {
|
||||
return "direct";
|
||||
}
|
||||
if (value === "group") {
|
||||
return "group";
|
||||
}
|
||||
if (value === "channel") {
|
||||
return "channel";
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user