(key: keyof Mapping, caseSensitive: boolean, path: string)
| 58 | } |
| 59 | |
| 60 | private pathMatch(key: keyof Mapping, caseSensitive: boolean, path: string): Mapping | undefined { |
| 61 | for (const mapping of this.sortedMappings[key]) { |
| 62 | let matched: boolean; |
| 63 | |
| 64 | if (caseSensitive) |
| 65 | matched = path.startsWith(mapping[key]); |
| 66 | else |
| 67 | matched = path.toLowerCase().startsWith(mapping[key].toLowerCase()); |
| 68 | |
| 69 | if (matched) |
| 70 | return mapping; |
| 71 | } |
| 72 | |
| 73 | return undefined; |
| 74 | } |
| 75 | |
| 76 | public toLocalPath(remotePath: string): string { |
| 77 | // Try to detect remote path. |
no outgoing calls
no test coverage detected