@servicenow/sdk - v4.7.0
    Preparing search index...
    • Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise, embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.

      Type Parameters

      • T

      Parameters

      • node: tsc.Node

        a given node to visit its children

      • cbNode: (node: tsc.Node) => T | undefined

        a callback to be invoked for all child nodes

      • OptionalcbNodes: (nodes: NodeArray<tsc.Node>) => T | undefined

        a callback to be invoked for embedded array

      Returns T | undefined

      forEachChild must visit the children of a node in the order that they appear in the source code. The language service depends on this property to locate nodes by position.