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

Function projectChecks

packages/effect/src/SchemaAST.ts:4718–4727  ·  view source on GitHub ↗
(ast: AST, checks: Checks)

Source from the content-addressed store, hash-verified

4716const preservesShape = new WeakSet<AST>()
4717
4718function projectChecks(ast: AST, checks: Checks): Checks | undefined {
4719 const structural = isArrays(ast) || isObjects(ast) || isDeclaration(ast) && ast.typeParameters.length > 0
4720 if (
4721 structural && checks.every(isStructuralCheck) ||
4722 everyNode(ast, (node) => !node.encoding && !isSuspend(node), preservesShape)
4723 ) {
4724 return checks
4725 }
4726 if (structural) return extractStructuralChecks(checks)
4727}
4728
4729function hasDirectionalParser(ast: AST): boolean {
4730 return isDeclaration(ast) && ast.encodingRun !== undefined && ast.encodingRun !== ast.run

Callers 2

sameFunction · 0.85
projectTypeFunction · 0.85

Calls 2

everyNodeFunction · 0.85
extractStructuralChecksFunction · 0.85

Tested by

no test coverage detected