(node: ts.Node, position: number)
| 29 | * @param position The target position within the `node`. |
| 30 | */ |
| 31 | export function findTightestNode(node: ts.Node, position: number): ts.Node | undefined { |
| 32 | if (node.getStart() <= position && position < node.getEnd()) { |
| 33 | return node.forEachChild((c) => findTightestNode(c, position)) ?? node; |
| 34 | } |
| 35 | return undefined; |
| 36 | } |
| 37 | |
| 38 | export interface FindOptions<T extends ts.Node> { |
| 39 | filter: (node: ts.Node) => node is T; |
no outgoing calls
no test coverage detected
searching dependent graphs…