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

Function isOpenStringBranch

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

Source from the content-addressed store, hash-verified

94
95/** A bare `{ "type": "string" }` branch - the open half of an open enum. */
96const isOpenStringBranch = (branch: unknown): boolean =>
97 isRecord(branch) && branch.type === "string" && Object.keys(branch).length === 1
98
99/** The value of a `{ "const": "..." }` branch, when it is a string const. */
100const constBranchValue = (branch: unknown): string | undefined =>

Callers 1

normalizeOpenEnumFunction · 0.85

Calls 1

isRecordFunction · 0.70

Tested by

no test coverage detected