* Use the relative path as the key to reduce session storage space for tracking.
(filePath: string)
| 865 | * Use the relative path as the key to reduce session storage space for tracking. |
| 866 | */ |
| 867 | function maybeShortenFilePath(filePath: string): string { |
| 868 | if (!isAbsolute(filePath)) { |
| 869 | return filePath |
| 870 | } |
| 871 | const cwd = getOriginalCwd() |
| 872 | if (filePath.startsWith(cwd)) { |
| 873 | return relative(cwd, filePath) |
| 874 | } |
| 875 | return filePath |
| 876 | } |
| 877 | |
| 878 | function maybeExpandFilePath(filePath: string): string { |
| 879 | if (isAbsolute(filePath)) { |
no test coverage detected