MCPcopy Index your code
hub / github.com/anomalyco/opencode / visitCurrent

Function visitCurrent

packages/httpapi-codegen/src/index.ts:823–843  ·  view source on GitHub ↗
(ast: SchemaAST.AST)

Source from the content-addressed store, hash-verified

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 ||

Callers 1

visitFunction · 0.85

Calls 4

annotationsPortableFunction · 0.85
checksPortableFunction · 0.85
generationPortableFunction · 0.85
visitFunction · 0.70

Tested by

no test coverage detected