Extract the function name from a function-ish node.
(node: any, source: string)
| 57 | |
| 58 | /** Extract the function name from a function-ish node. */ |
| 59 | function funcName(node: any, source: string): string { |
| 60 | const n = node.childForFieldName?.('name'); |
| 61 | if (n) return source.slice(n.startIndex, n.endIndex); |
| 62 | return '<anonymous>'; |
| 63 | } |
| 64 | |
| 65 | /** Collect identifier strings declared as parameters within `node`. */ |
| 66 | function collectParams(node: any, source: string, into: Set<string>): void { |