MCPcopy Create free account
hub / github.com/Effect-TS/effect / constBranchValue

Function constBranchValue

packages/tools/ai-codegen/src/Generator.ts:100–101  ·  view source on GitHub ↗
(branch: unknown)

Source from the content-addressed store, hash-verified

98
99/** The value of a `{ "const": "..." }` branch, when it is a string const. */
100const constBranchValue = (branch: unknown): string | undefined =>
101 isRecord(branch) && Predicate.isString(branch.const) ? branch.const : undefined
102
103/**
104 * Collapse an open enum's const branches into a single `enum` branch.

Callers 1

normalizeOpenEnumFunction · 0.85

Calls 1

isRecordFunction · 0.70

Tested by

no test coverage detected