MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / getChildNodes

Function getChildNodes

src/analyzers/react/index.ts:591–605  ·  view source on GitHub ↗
(node: TSESTree.Node)

Source from the content-addressed store, hash-verified

589}
590
591function getChildNodes(node: TSESTree.Node): TSESTree.Node[] {
592 const children: TSESTree.Node[] = [];
593 for (const value of Object.values(node)) {
594 if (Array.isArray(value)) {
595 for (const item of value) {
596 if (isNode(item)) {
597 children.push(item);
598 }
599 }
600 } else if (isNode(value)) {
601 children.push(value);
602 }
603 }
604 return children;
605}
606
607function isNode(value: unknown): value is TSESTree.Node {
608 return value !== null && typeof value === 'object' && 'type' in value;

Callers 1

walkAstFunction · 0.85

Calls 1

isNodeFunction · 0.85

Tested by

no test coverage detected