mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 16:54:31 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -26,17 +26,23 @@ export type InlineActionResult =
|
||||
};
|
||||
|
||||
function extractTextFromToolResult(result: any): string | null {
|
||||
if (!result || typeof result !== "object") return null;
|
||||
if (!result || typeof result !== "object") {
|
||||
return null;
|
||||
}
|
||||
const content = (result as { content?: unknown }).content;
|
||||
if (typeof content === "string") {
|
||||
const trimmed = content.trim();
|
||||
return trimmed ? trimmed : null;
|
||||
}
|
||||
if (!Array.isArray(content)) return null;
|
||||
if (!Array.isArray(content)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const parts: string[] = [];
|
||||
for (const block of content) {
|
||||
if (!block || typeof block !== "object") continue;
|
||||
if (!block || typeof block !== "object") {
|
||||
continue;
|
||||
}
|
||||
const rec = block as { type?: unknown; text?: unknown };
|
||||
if (rec.type === "text" && typeof rec.text === "string") {
|
||||
parts.push(rec.text);
|
||||
@@ -212,8 +218,12 @@ export async function handleInlineActions(params: {
|
||||
}
|
||||
|
||||
const sendInlineReply = async (reply?: ReplyPayload) => {
|
||||
if (!reply) return;
|
||||
if (!opts?.onBlockReply) return;
|
||||
if (!reply) {
|
||||
return;
|
||||
}
|
||||
if (!opts?.onBlockReply) {
|
||||
return;
|
||||
}
|
||||
await opts.onBlockReply(reply);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user