MCPcopy
hub / github.com/Effect-TS/effect / transformLiterals

Function transformLiterals

packages/effect/src/Schema.ts:4053–4057  ·  view source on GitHub ↗
(...pairs: A)

Source from the content-addressed store, hash-verified

4051 const A extends ReadonlyArray<readonly [from: AST.LiteralValue, to: AST.LiteralValue]>
4052>(...pairs: A): Schema<A[number][1], A[number][0]>
4053export function transformLiterals<
4054 const A extends ReadonlyArray<readonly [from: AST.LiteralValue, to: AST.LiteralValue]>
4055>(...pairs: A): Schema<A[number][1], A[number][0]> {
4056 return Union(...pairs.map(([from, to]) => transformLiteral(from, to)))
4057}
4058
4059/**
4060 * Attaches a property signature with the specified key and value to the schema.

Callers

nothing calls this directly

Calls 3

UnionFunction · 0.70
transformLiteralFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected