(currNode: ts.Node)
| 46 | export function findAllMatchingNodes<T extends ts.Node>(root: ts.Node, opts: FindOptions<T>): T[] { |
| 47 | const matches: T[] = []; |
| 48 | const explore = (currNode: ts.Node) => { |
| 49 | if (opts.filter(currNode)) { |
| 50 | matches.push(currNode); |
| 51 | } |
| 52 | currNode.forEachChild((descendent) => explore(descendent)); |
| 53 | }; |
| 54 | explore(root); |
| 55 | return matches; |
| 56 | } |
no test coverage detected