(ast: AST, checks: Checks)
| 4716 | const preservesShape = new WeakSet<AST>() |
| 4717 | |
| 4718 | function 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 | |
| 4729 | function hasDirectionalParser(ast: AST): boolean { |
| 4730 | return isDeclaration(ast) && ast.encodingRun !== undefined && ast.encodingRun !== ast.run |
no test coverage detected