MCPcopy Index your code
hub / github.com/anomalyco/opencode / configData

Function configData

packages/opencode/src/cli/error.ts:11–16  ·  view source on GitHub ↗
(input: unknown, tag: string)

Source from the content-addressed store, hash-verified

9}
10
11function configData(input: unknown, tag: string): Record<string, unknown> | undefined {
12 if (!isRecord(input)) return undefined
13 if (input.name === tag && isRecord(input.data)) return input.data
14 if (input._tag === tag) return input
15 return undefined
16}
17
18function stringField(input: Record<string, unknown>, key: string): string | undefined {
19 return typeof input[key] === "string" ? input[key] : undefined

Callers 1

FormatErrorFunction · 0.70

Calls 1

isRecordFunction · 0.90

Tested by

no test coverage detected