(inputDir: string)
| 51 | export async function loadProvider(inputDir: string, provider: string): Promise<ProviderSource> { |
| 52 | const filePath = path.join(inputDir, `${provider}.yaml`); |
| 53 | return parseProviderFile(filePath); |
| 54 | } |
| 55 | |
| 56 | export async function loadAllProviders(inputDir: string): Promise<ProviderSource[]> { |
| 57 | const entries = await readdir(inputDir, { withFileTypes: true }); |
| 58 | const files = entries |
| 59 | .filter((entry) => entry.isFile() && /\.ya?ml$/i.test(entry.name)) |
| 60 | .map((entry) => path.join(inputDir, entry.name)) |
| 61 | .sort(); |
| 62 | |
| 63 | const providers = await Promise.all(files.map((file) => parseProviderFile(file))); |
| 64 | return providers.sort((a, b) => a.provider.localeCompare(b.provider)); |
| 65 | } |
no test coverage detected