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

Function literalToString

packages/effect/src/SchemaAST.ts:1334–1345  ·  view source on GitHub ↗
(ast: Literal)

Source from the content-addressed store, hash-verified

1332}
1333
1334function literalToString(ast: Literal): Literal {
1335 const literalAsString = globalThis.String(ast.literal)
1336 return replaceEncoding(ast, [
1337 new Link(
1338 new Literal(literalAsString),
1339 new SchemaTransformation.Transformation(
1340 SchemaGetter.transform(() => ast.literal),
1341 SchemaGetter.transform(() => literalAsString)
1342 )
1343 )
1344 ])
1345}
1346
1347/**
1348 * AST node matching any `string` value.

Callers 2

toCodecJsonMethod · 0.85
toCodecStringTreeMethod · 0.85

Calls 2

replaceEncodingFunction · 0.85
transformMethod · 0.65

Tested by

no test coverage detected