mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Change comment to jsdoc
This commit is contained in:
+10
-4
@@ -46,10 +46,16 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
// 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.
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param node a given node to visit its children
|
||||
* @param cbNode a callback to be invoked for all child nodes
|
||||
* @param cbNodeArray a callback to be invoked for embedded array
|
||||
*/
|
||||
export function forEachChild<T>(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T {
|
||||
if (!node) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user