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

Function canReuse

packages/effect/src/SchemaAST.ts:4733–4740  ·  view source on GitHub ↗
(root: AST, edge: Suspend["thunk"])

Source from the content-addressed store, hash-verified

4731}
4732
4733function canReuse(root: AST, edge: Suspend["thunk"]): boolean {
4734 function same(ast: AST): boolean {
4735 if (isSuspend(ast)) return ast.thunk === edge
4736 return !hasDirectionalParser(ast) &&
4737 !("encodingChecks" in ast && ast.checks && projectChecks(ast, ast.checks) !== ast.checks)
4738 }
4739 return everyNode(root, same)
4740}
4741
4742const types = new WeakMap<AST, AST>()
4743const reversed = new WeakMap<AST, AST>()

Callers 1

reverseBodyFunction · 0.85

Calls 1

everyNodeFunction · 0.85

Tested by

no test coverage detected