(n: any, depth: number)
| 164 | |
| 165 | // Find function nodes anywhere in the tree (depth-unbounded, like ast-chunk). |
| 166 | const findFns = (n: any, depth: number) => { |
| 167 | if (depth > 12 || !n) return; |
| 168 | if (FUNC_NODE_RE.test(n.type)) { |
| 169 | analyzeFunction(n); |
| 170 | // still descend — nested functions are analyzed too |
| 171 | } |
| 172 | for (let i = 0; i < (n.childCount ?? 0); i++) findFns(n.child(i), depth + 1); |
| 173 | }; |
| 174 | findFns(tree.rootNode, 0); |
| 175 | |
| 176 | return results; |
no test coverage detected