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

Class TemplateLiteralParserClass

packages/effect/src/Schema.ts:950–961  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

948 to = to.annotations({ [AST.AutoTitleAnnotationId]: format(Tuple(...schemas)) })
949 }
950 return class TemplateLiteralParserClass extends transformOrFail(from, to, {
951 strict: false,
952 decode: (i, _, ast) => {
953 const match = re.exec(i)
954 return match
955 ? ParseResult.succeed(match.slice(1, params.length + 1))
956 : ParseResult.fail(new ParseResult.Type(ast, i, `${re.source}: no match for ${JSON.stringify(i)}`))
957 },
958 encode: (tuple) => ParseResult.succeed(tuple.join(""))
959 }) {
960 static params = params.slice()
961 } as any
962}
963
964const declareConstructor = <

Callers

nothing calls this directly

Calls 3

transformOrFailInterface · 0.85
failMethod · 0.65
joinMethod · 0.65

Tested by

no test coverage detected