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

Function TaggedStruct

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

Source from the content-addressed store, hash-verified

6181 * @since 3.10.0
6182 */
6183export function TaggedStruct<const Tag extends SchemaAST.LiteralValue, const Fields extends Struct.Fields>(
6184 value: Tag,
6185 fields: Fields
6186): TaggedStruct<Tag, Fields> {
6187 return Struct({ _tag: tag(value), ...fields })
6188}
6189
6190/**
6191 * Recursively flatten any nested Schema.Union members into a single tuple of leaf schemas.

Callers 1

TaggedUnionFunction · 0.85

Calls 2

StructFunction · 0.70
tagFunction · 0.70

Tested by

no test coverage detected