(nodes: Node[], source = 'target();')
| 12 | startLine: 1, endLine: 1, startColumn: 0, endColumn: 0, updatedAt: 0, ...extra }; |
| 13 | } |
| 14 | function context(nodes: Node[], source = 'target();'): ResolutionContext { |
| 15 | return { |
| 16 | getNodesByName: name => nodes.filter(n => n.name === name), |
| 17 | getNodesByLowerName: name => nodes.filter(n => n.name.toLowerCase() === name), |
| 18 | getNodesByQualifiedName: name => nodes.filter(n => n.qualifiedName === name), |
| 19 | getNodesByKind: kind => nodes.filter(n => n.kind === kind), |
| 20 | getNodesInFile: file => nodes.filter(n => n.filePath === file), |
| 21 | getImportMappings: () => [], getAllFiles: () => [], getProjectRoot: () => '/project', |
| 22 | fileExists: () => true, |
| 23 | readFile: file => file === 'lib/caller.js' ? source : 'function target() {}', |
| 24 | getFileLines: file => (file === 'lib/caller.js' ? source : 'function target() {}').split('\n'), |
| 25 | }; |
| 26 | } |
| 27 | const ref: UnresolvedRef = { fromNodeId: 'caller', referenceName: 'target', referenceKind: 'calls', |
| 28 | filePath: 'lib/caller.js', language: 'javascript', line: 1, column: 0 }; |
| 29 |
no outgoing calls
no test coverage detected