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

Function makeConstructorParser

packages/effect/src/SchemaParser.ts:1071–1079  ·  view source on GitHub ↗
(descriptor: SchemaAST.ConstructorDescriptor, compile: Compiler)

Source from the content-addressed store, hash-verified

1069}
1070
1071function makeConstructorParser(descriptor: SchemaAST.ConstructorDescriptor, compile: Compiler): Parser {
1072 let sourceParser: Parser
1073 return (input, options) => {
1074 if (input === InternalParser.missing) return InternalParser.missingExit
1075 if (descriptor.isConstructed(input)) return InternalParser.sameExit
1076 const result = (sourceParser ??= compile(descriptor.link.to))(input, options)
1077 return applyTransformation(result, input, descriptor.link.transformation, options)
1078 }
1079}
1080
1081function makeParser(
1082 ast: SchemaAST.AST,

Callers 1

makeParserFunction · 0.85

Calls 2

applyTransformationFunction · 0.85
compileFunction · 0.50

Tested by

no test coverage detected