| 185 | * when the section, server, or entry shape is missing. |
| 186 | */ |
| 187 | export function getJsonServerEntry( |
| 188 | config: Record<string, unknown>, |
| 189 | configKey: string, |
| 190 | serverName: string |
| 191 | ): Record<string, unknown> | undefined { |
| 192 | const section = config[configKey]; |
| 193 | if (!section || typeof section !== "object") return undefined; |
| 194 | const entry = (section as Record<string, unknown>)[serverName]; |
| 195 | return entry && typeof entry === "object" ? (entry as Record<string, unknown>) : undefined; |
| 196 | } |
| 197 | |
| 198 | function stripApiKeyPair(args: string[]): string[] { |
| 199 | const result: string[] = []; |