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

Function canMatch

packages/effect/src/SchemaAST.ts:4978–4986  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4976 let untried: Array<number> | undefined
4977 let attemptsLeft = parts.length * 2
4978 function canMatch(): boolean {
4979 if (
4980 --attemptsLeft < 0 &&
4981 parts.some((part) => part.checks || (part._tag !== "String" && part._tag !== "Number" && part._tag !== "Literal"))
4982 ) {
4983 attemptsLeft = Infinity
4984 }
4985 return attemptsLeft >= 0
4986 }
4987
4988 function go(i: number, pos: number): boolean {
4989 if (i === parts.length) return pos === inputLength

Callers 1

goFunction · 0.85

Calls 1

someMethod · 0.80

Tested by

no test coverage detected