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

Method getParser

packages/effect/src/SchemaAST.ts:1069–1075  ·  view source on GitHub ↗

@internal

()

Source from the content-addressed store, hash-verified

1067 }
1068 /** @internal */
1069 getParser() {
1070 const values = new Set<unknown>(this.enums.map(([, v]) => v))
1071 return fromRefinement(
1072 this,
1073 (input): input is typeof this.enums[number][1] => values.has(input)
1074 )
1075 }
1076 /** @internal */
1077 toCodecStringTree(): AST {
1078 if (this.enums.some(([_, v]) => typeof v === "number")) {

Callers

nothing calls this directly

Calls 3

fromRefinementFunction · 0.85
mapMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected