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

Function providerList

packages/opencode/test/server/httpapi-provider.test.ts:45–49  ·  view source on GitHub ↗
(input: unknown, key: "all" | "providers")

Source from the content-addressed store, hash-verified

43}
44
45function providerList(input: unknown, key: "all" | "providers") {
46 if (!isRecord(input)) return []
47 if (!Array.isArray(input[key])) return []
48 return input[key]
49}
50
51function providerByID(input: unknown, key: "all" | "providers", id: string) {
52 return providerList(input, key).find((provider) => isRecord(provider) && provider.id === id)

Callers 1

providerByIDFunction · 0.70

Calls 1

isRecordFunction · 0.70

Tested by

no test coverage detected