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

Function TaggedStruct

packages/effect/src/Schema.ts:6380–6385  ·  view source on GitHub ↗
(
  value: Tag,
  fields: Fields
)

Source from the content-addressed store, hash-verified

6378 * @since 3.10.0
6379 */
6380export function TaggedStruct<const Tag extends SchemaAST.LiteralValue, const Fields extends Struct.Fields>(
6381 value: Tag,
6382 fields: Fields
6383): TaggedStruct<Tag, Fields> {
6384 return Struct({ _tag: tag(value), ...fields }) as any
6385}
6386/**
6387 * Recursively flatten any nested Schema.Union members into a single tuple of leaf schemas.
6388 */

Callers 2

TaggedUnionFunction · 0.85
dnsRecordOfTypeFunction · 0.85

Calls 2

StructFunction · 0.70
tagFunction · 0.70

Tested by

no test coverage detected