| 52 | * and, through an instance, its methods, as it reaches a declaration's. |
| 53 | */ |
| 54 | export function isCommonJsExportedClass(node: Node, lines: readonly string[]): boolean { |
| 55 | const line = lines[node.startLine - 1]; |
| 56 | if (line === undefined) return false; |
| 57 | return COMMONJS_EXPORT_BEFORE.test(`${lines[node.startLine - 2] ?? ''}\n${line.slice(0, node.startColumn)}`); |
| 58 | } |
| 59 | |
| 60 | /** Whether the reference is written inside `node`'s source range. */ |
| 61 | export function writtenIn(node: Node, ref: UnresolvedRef): boolean { |