MCPcopy Create free account
hub / github.com/VPSDance/ai-proxy-rules / parseFormats

Function parseFormats

scripts/cli.ts:90–103  ·  view source on GitHub ↗
(formatOption: string)

Source from the content-addressed store, hash-verified

88 aggregateProvidersByScope(providers, "cn", "cn", "China AI Providers", "Aggregated China AI provider rules."),
89 aggregateProvidersByScope(providers, "global", "global", "Global AI Providers", "Aggregated global AI provider rules."),
90 aggregateProviders(providers)
91 ];
92 }
93
94 return providerTargets;
95}
96
97function parseFormats(formatOption: string): Format[] {
98 const selected = parseCsv(formatOption);
99
100 if (selected.includes("all")) {
101 return [...formats];
102 }
103
104 const invalid = selected.filter((format): format is string => !isFormat(format));
105 if (invalid.length > 0) {
106 throw new Error(`Invalid format: ${invalid.join(", ")}`);

Callers 1

generateFunction · 0.85

Calls 2

isFormatFunction · 0.85
parseCsvFunction · 0.70

Tested by

no test coverage detected