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

Function filterLiterals

packages/effect/src/SchemaAST.ts:2779–2788  ·  view source on GitHub ↗
(input: any)

Source from the content-addressed store, hash-verified

2777}
2778
2779function filterLiterals(input: any) {
2780 return (ast: AST) => {
2781 const encoded = toCandidate(ast)
2782 return encoded._tag === "Literal" ?
2783 encoded.literal === input
2784 : encoded._tag === "UniqueSymbol" ?
2785 encoded.symbol === input
2786 : true
2787 }
2788}
2789
2790/**
2791 * The goal is to reduce the number of a union members that will be checked.

Callers 1

getIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected