chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -12,7 +12,9 @@ export function decodeDataUrl(dataUrl: string): {
} {
const trimmed = dataUrl.trim();
const match = /^data:([^;,]+);base64,([a-z0-9+/=\r\n]+)$/i.exec(trimmed);
if (!match) throw new Error("Invalid data URL (expected base64 data: URL).");
if (!match) {
throw new Error("Invalid data URL (expected base64 data: URL).");
}
const mimeType = (match[1] ?? "").trim().toLowerCase();
if (!mimeType.startsWith("image/")) {
throw new Error(`Unsupported data URL type: ${mimeType || "unknown"}`);
@@ -43,7 +45,9 @@ export function coerceImageAssistantText(params: {
throw new Error(`Image model failed (${params.provider}/${params.model}): ${errorMessage}`);
}
const text = extractAssistantText(params.message);
if (text.trim()) return text.trim();
if (text.trim()) {
return text.trim();
}
throw new Error(`Image model returned no text (${params.provider}/${params.model}).`);
}