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

Function buildTargets

scripts/cli.ts:79–88  ·  view source on GitHub ↗
(providers: ProviderSource[], providerOption: string)

Source from the content-addressed store, hash-verified

77 return providers.sort((a, b) => a.provider.localeCompare(b.provider));
78}
79
80function buildTargets(providers: ProviderSource[], providerOption: string): RenderTarget[] {
81 const providerTargets = providers.map(providerToTarget);
82 const providerNames = parseCsv(providerOption);
83
84 if (providerNames.includes("all") || providers.length > 1) {
85 return [
86 ...providerTargets,
87 ...aggregateProvidersByCategory(providers),
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 ];

Callers 1

generateFunction · 0.85

Calls 3

aggregateProvidersFunction · 0.85
parseCsvFunction · 0.70

Tested by

no test coverage detected