MCPcopy Create free account
hub / github.com/arktypeio/arktype / forEachChild

Function forEachChild

ark/aot/scope.ts:882–890  ·  view source on GitHub ↗
(node: Node, f: (child: Node) => void)

Source from the content-addressed store, hash-verified

880}
881
882const forEachChild = (node: Node, f: (child: Node) => void) => {
883 for (const k of visitorKeys[node.type]) {
884 if (k in typeKeys) continue
885 const child = (node as never)[k] as Node | (Node | null)[] | null
886 if (!Array.isArray(child)) {
887 if (child) f(child)
888 } else for (const item of child) if (item) f(item)
889 }
890}
891
892const moduleSyntaxKinds = {
893 ImportDeclaration: 1,

Callers 2

visitChildrenMethod · 0.85
walkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected