File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,10 +46,16 @@ namespace ts {
4646 }
4747 }
4848
49- // Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
50- // stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,
51- // embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns
52- // a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.
49+ /**
50+ * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
51+ * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,
52+ * embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns
53+ * a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.
54+ *
55+ * @param node a given node to visit its children
56+ * @param cbNode a callback to be invoked for all child nodes
57+ * @param cbNodeArray a callback to be invoked for embedded array
58+ */
5359 export function forEachChild < T > ( node : Node , cbNode : ( node : Node ) => T , cbNodeArray ?: ( nodes : Node [ ] ) => T ) : T {
5460 if ( ! node ) {
5561 return ;
You can’t perform that action at this time.
0 commit comments