mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:51:37 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -12,12 +12,18 @@ export function extractInlineSimpleCommand(body?: string): {
|
||||
command: string;
|
||||
cleaned: string;
|
||||
} | null {
|
||||
if (!body) return null;
|
||||
if (!body) {
|
||||
return null;
|
||||
}
|
||||
const match = body.match(INLINE_SIMPLE_COMMAND_RE);
|
||||
if (!match || match.index === undefined) return null;
|
||||
if (!match || match.index === undefined) {
|
||||
return null;
|
||||
}
|
||||
const alias = `/${match[1].toLowerCase()}`;
|
||||
const command = INLINE_SIMPLE_COMMAND_ALIASES.get(alias);
|
||||
if (!command) return null;
|
||||
if (!command) {
|
||||
return null;
|
||||
}
|
||||
const cleaned = body.replace(match[0], " ").replace(/\s+/g, " ").trim();
|
||||
return { command, cleaned };
|
||||
}
|
||||
@@ -27,7 +33,9 @@ export function stripInlineStatus(body: string): {
|
||||
didStrip: boolean;
|
||||
} {
|
||||
const trimmed = body.trim();
|
||||
if (!trimmed) return { cleaned: "", didStrip: false };
|
||||
if (!trimmed) {
|
||||
return { cleaned: "", didStrip: false };
|
||||
}
|
||||
const cleaned = trimmed.replace(INLINE_STATUS_RE, " ").replace(/\s+/g, " ").trim();
|
||||
return { cleaned, didStrip: cleaned !== trimmed };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user