core3-utils

@wixc3/typescript on Github

Home > @wixc3/typescript > findNode

findNode() function

Finds the first node (via DFS) satisfying the predicate

Signature:

export declare function findNode(source: ts.Node | ts.Node[], predicate: Predicate<ts.Node>): ts.Node | undefined;

Parameters

Parameter Type Description
source ts.Node \| ts.Node\[\]
predicate [Predicate](/core3-utils/common.predicate.html)<ts.Node>

Returns:

ts.Node | undefined