fix(lint): remove redundant unknown unions · openclaw/openclaw@5f85e6b
vincentkoc
·
2026-05-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -40,20 +40,6 @@ const SUPPORTED_ASPECT_RATIOS = [
|
40 | 40 | ] as const; |
41 | 41 | const OPENROUTER_IMAGE_MALFORMED_RESPONSE = "OpenRouter image generation response malformed"; |
42 | 42 | |
43 | | -type OpenRouterImageEntry = { |
44 | | -image_url?: { url?: string }; |
45 | | -imageUrl?: { url?: string }; |
46 | | -}; |
47 | | - |
48 | | -type OpenRouterChatCompletionResponse = { |
49 | | -choices?: Array<{ |
50 | | -message?: { |
51 | | -content?: string | unknown[] | null; |
52 | | -images?: OpenRouterImageEntry[]; |
53 | | -}; |
54 | | -}>; |
55 | | -}; |
56 | | - |
57 | 43 | function isRecord(value: unknown): value is Record<string, unknown> { |
58 | 44 | return Boolean(value && typeof value === "object" && !Array.isArray(value)); |
59 | 45 | } |
@@ -150,7 +136,7 @@ function extractImagesFromPart(
|
150 | 136 | } |
151 | 137 | |
152 | 138 | export function extractOpenRouterImagesFromResponse( |
153 | | -body: OpenRouterChatCompletionResponse | unknown, |
| 139 | +body: unknown, |
154 | 140 | options: { malformedResponseError?: string } = {}, |
155 | 141 | ): GeneratedImageAsset[] { |
156 | 142 | if (!isRecord(body)) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。