* Normalize a file path to be relative to root and use forward slashes
(filePath: string)
| 647 | * Normalize a file path to be relative to root and use forward slashes |
| 648 | */ |
| 649 | private normalizePath(filePath: string): string { |
| 650 | // Convert backslashes to forward slashes |
| 651 | let normalized = filePath.replace(/\\/g, '/'); |
| 652 | |
| 653 | // Make relative to root if absolute |
| 654 | if (normalized.startsWith(this.rootPath)) { |
| 655 | normalized = normalized.slice(this.rootPath.length); |
| 656 | if (normalized.startsWith('/')) { |
| 657 | normalized = normalized.slice(1); |
| 658 | } |
| 659 | } |
| 660 | |
| 661 | // Remove leading ./ if present |
| 662 | if (normalized.startsWith('./')) { |
| 663 | normalized = normalized.slice(2); |
| 664 | } |
| 665 | |
| 666 | return normalized; |
| 667 | } |
| 668 | |
| 669 | /** |
| 670 | * Track that importingFile imports importedFile |
no outgoing calls
no test coverage detected