MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / visit

Function visit

cli/src/utils/__tests__/markdown-renderer.test.tsx:12–28  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

10 const result: React.ReactNode[] = []
11
12 const visit = (value: unknown): void => {
13 if (value === null || value === undefined || typeof value === 'boolean') {
14 return
15 }
16
17 if (Array.isArray(value)) {
18 value.forEach(visit)
19 return
20 }
21
22 if (React.isValidElement(value) && value.type === React.Fragment) {
23 visit((value as El).props.children)
24 return
25 }
26
27 result.push(value as React.ReactNode)
28 }
29
30 visit(input)
31 return result

Callers 1

flattenNodesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected