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

Function literalToString

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

Source from the content-addressed store, hash-verified

1835}
1836
1837function literalToString(ast: Literal): Literal {
1838 const literalAsString = globalThis.String(ast.literal)
1839 return replaceEncoding(ast, [
1840 new Link(
1841 new Literal(literalAsString),
1842 new SchemaTransformation.Transformation(
1843 SchemaGetter.transform(() => ast.literal),
1844 SchemaGetter.transform(() => literalAsString)
1845 )
1846 )
1847 ])
1848}
1849
1850/**
1851 * 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