(input: unknown, reservedNames: readonly string[] = [])
| 58 | * Normalize a single source or a batch into a validated list. |
| 59 | */ |
| 60 | export function parseSourceConfigs(input: unknown, reservedNames: readonly string[] = []): ParsedDataSourceConfig[] { |
| 61 | const configs = Array.isArray(input) ? input : [input]; |
| 62 | if (configs.length === 0) throw new Error('At least one data source is required'); |
| 63 | |
| 64 | return assignSourceNames( |
| 65 | Array.from(configs, (config) => sourceInputSchema.parse(config)), |
| 66 | reservedNames |
| 67 | ); |
| 68 | } |
no test coverage detected