* Extracts a file path from a file:// URI, decoding percent-encoded characters.
(uri: string)
| 536 | * Extracts a file path from a file:// URI, decoding percent-encoded characters. |
| 537 | */ |
| 538 | function uriToFilePath(uri: string): string { |
| 539 | let filePath = uri.replace(/^file:\/\//, '') |
| 540 | // On Windows, file:///C:/path becomes /C:/path — strip the leading slash |
| 541 | if (/^\/[A-Za-z]:/.test(filePath)) { |
| 542 | filePath = filePath.slice(1) |
| 543 | } |
| 544 | try { |
| 545 | filePath = decodeURIComponent(filePath) |
| 546 | } catch { |
| 547 | // Use un-decoded path if malformed |
| 548 | } |
| 549 | return filePath |
| 550 | } |
| 551 | |
| 552 | /** |
| 553 | * Filters out locations whose file paths are gitignored. |
no outgoing calls
no test coverage detected