Skip to main content
Module

x/ts_morph/mod.ts>Node#forEachChild

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
method Node.prototype.forEachChild
import { Node } from "https://deno.land/x/ts_morph@15.1.0/mod.ts";

Invokes the cbNode callback for each child and the cbNodeArray for every array of nodes stored in properties of the node. If cbNodeArray is not defined, then it will pass every element of the array to cbNode.

Parameters

cbNode: (node: Node) => T | undefined
  • Callback invoked for each child.
optional
cbNodeArray: (nodes: Node[]) => T | undefined
  • Callback invoked for each array of nodes.

Returns

T | undefined

The first truthy value returned by a callback.