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

Function visit

packages/effect/src/ui/MessageLog.ts:1939–1964  ·  view source on GitHub ↗
(node: SchemaAST.AST)

Source from the content-addressed store, hash-verified

1937const holdsRedactedOverlap = memoize((ast: SchemaAST.AST): boolean => {
1938 const seen = new Set<SchemaAST.AST>()
1939 const visit = (node: SchemaAST.AST): boolean => {
1940 if (seen.has(node)) return false
1941 seen.add(node)
1942 if (
1943 node.encoding !== undefined &&
1944 node.encoding.some((link) => visit(link.to))
1945 ) return true
1946 switch (node._tag) {
1947 case "Objects":
1948 return (node.indexSignatures.length + node.propertySignatures.length >
1949 1 &&
1950 node.indexSignatures.some((index) => holdsRedacted(index.type))) ||
1951 node.propertySignatures.some((property) => visit(property.type)) ||
1952 node.indexSignatures.some((index) => visit(index.type))
1953 case "Arrays":
1954 return node.elements.some(visit) || node.rest.some(visit)
1955 case "Union":
1956 return node.types.some(visit)
1957 case "Suspend":
1958 return visit(node.thunk())
1959 case "Declaration":
1960 return node.typeParameters.some(visit)
1961 default:
1962 return false
1963 }
1964 }
1965 return visit(ast)
1966})
1967

Callers 1

MessageLog.tsFile · 0.70

Calls 3

someMethod · 0.80
hasMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected