(ast: SchemaAST.AST)
| 821 | return result |
| 822 | } |
| 823 | const visitCurrent = (ast: SchemaAST.AST): boolean => { |
| 824 | if (!annotationsPortable(ast.annotations)) return false |
| 825 | if (!checksPortable(ast.checks) || ("encodingChecks" in ast && !checksPortable(ast.encodingChecks))) return false |
| 826 | if (SchemaAST.isDeclaration(ast)) { |
| 827 | return generationPortable(ast.annotations?.generation) && ast.typeParameters.every(visit) |
| 828 | } |
| 829 | if (ast.encoding !== undefined && ast.annotations?.generation === undefined) return false |
| 830 | if (SchemaAST.isSuspend(ast)) return visit(ast.thunk()) |
| 831 | if (SchemaAST.isUnion(ast)) return ast.types.every(visit) |
| 832 | if (SchemaAST.isArrays(ast)) { |
| 833 | return ast.elements.every(visit) && ast.rest.every(visit) |
| 834 | } |
| 835 | if (SchemaAST.isObjects(ast)) { |
| 836 | return ( |
| 837 | ast.propertySignatures.every((field) => visit(field.type)) && |
| 838 | ast.indexSignatures.every((index) => visit(index.parameter) && visit(index.type)) |
| 839 | ) |
| 840 | } |
| 841 | if (SchemaAST.isTemplateLiteral(ast)) return ast.parts.every(visit) |
| 842 | return true |
| 843 | } |
| 844 | if (taggedError !== undefined && SchemaAST.isDeclaration(schema.ast)) { |
| 845 | if ( |
| 846 | schema.ast.checks !== undefined || |
no test coverage detected