MCPcopy Create free account
hub / github.com/anomalyco/opencode / normalizeProviderList

Function normalizeProviderList

packages/app/src/context/global-sync/utils.ts:21–39  ·  view source on GitHub ↗
(input: ProviderListResponse)

Source from the content-addressed store, hash-verified

19}
20
21export function normalizeProviderList(input: ProviderListResponse): NormalizedProviderListResponse {
22 return {
23 ...input,
24 all: new Map(
25 input.all.map(
26 (provider) =>
27 [
28 provider.id,
29 {
30 ...provider,
31 models: Object.fromEntries(
32 Object.entries(provider.models).filter(([, info]) => info.status !== "deprecated"),
33 ),
34 },
35 ] as const,
36 ),
37 ),
38 }
39}
40
41export function sanitizeProject(project: Project) {
42 if (!project.icon?.url && !project.icon?.override) return project

Callers 1

loadProvidersQueryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected