(filePath: string)
| 8421 | // a changed file's indexed line numbers can point at other code (#1474). |
| 8422 | const read = new Map<string, { content: string; lines: string[] } | null>(); |
| 8423 | const readFile = (filePath: string) => { |
| 8424 | const held = read.get(filePath); |
| 8425 | if (held !== undefined) return held; |
| 8426 | let entry: { content: string; lines: string[] } | null = null; |
| 8427 | try { |
| 8428 | const abs = validatePathWithinRoot(projectRoot, filePath); |
| 8429 | if (abs && existsSync(abs)) { |
| 8430 | const content = readFileSync(abs, 'utf-8'); |
| 8431 | if (!this.isFileStaleOnDisk(cg, filePath, content)) entry = { content, lines: content.split(/\r?\n/) }; |
| 8432 | } |
| 8433 | } catch { |
| 8434 | entry = null; |
| 8435 | } |
| 8436 | read.set(filePath, entry); |
| 8437 | return entry; |
| 8438 | }; |
| 8439 | |
| 8440 | const isTest = this.testCodeReading(cg); |
| 8441 | const rel = (p: string) => p.replace(/\\/g, '/'); |
nothing calls this directly
no test coverage detected