( cg: CodeGraph, requested: string )
| 68 | * itself handed us). |
| 69 | */ |
| 70 | export function findIndexedFile( |
| 71 | cg: CodeGraph, |
| 72 | requested: string |
| 73 | ): { record: FileRecord; storedPath: string } | null { |
| 74 | const posix = toRequestPath(requested); |
| 75 | const record = cg.getFile(posix); |
| 76 | if (record) return { record, storedPath: posix }; |
| 77 | |
| 78 | const native = posix.split('/').join(path.sep); |
| 79 | if (native !== posix) { |
| 80 | const legacy = cg.getFile(native); |
| 81 | if (legacy) return { record: legacy, storedPath: native }; |
| 82 | } |
| 83 | return null; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Forward slashes and no leading `./` — the form indexed paths are stored in. |
no test coverage detected