(filePath: string)
| 110 | } |
| 111 | |
| 112 | async function loadSourceProvider(filePath: string): Promise<SourceProvider> { |
| 113 | const raw = await readFile(filePath, "utf8"); |
| 114 | const result = sourceProviderSchema.safeParse(parse(raw)); |
| 115 | if (!result.success) { |
| 116 | throw new Error(`Invalid source config in ${filePath}:\n${z.prettifyError(result.error)}`); |
| 117 | } |
| 118 | return result.data; |
| 119 | } |
| 120 | |
| 121 | function stringifyProviderData(provider: SourceProviderData): string { |
| 122 | return stringify(provider, { |