* Rebases a local path to a remote one using the remote and local roots. * The path should should given as a filesystem path, not a URI.
(localPath: string)
| 171 | * The path should should given as a filesystem path, not a URI. |
| 172 | */ |
| 173 | public rebaseLocalToRemote(localPath: string) { |
| 174 | if (!this.options.remoteRoot || !this.options.localRoot || !this.canMapPath(localPath)) { |
| 175 | return localPath; |
| 176 | } |
| 177 | |
| 178 | const relPath = properRelative(this.options.localRoot, localPath); |
| 179 | let remotePath = properJoin(this.options.remoteRoot, relPath); |
| 180 | |
| 181 | remotePath = fixDriveLetterAndSlashes(remotePath, /*uppercaseDriveLetter=*/ true); |
| 182 | this.logger.verbose( |
| 183 | LogTag.RuntimeSourceMap, |
| 184 | `Mapped localToRemote: ${localPath} -> ${remotePath}`, |
| 185 | ); |
| 186 | return remotePath; |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * Normalizes a source map URL for further processing. Should be called |
nothing calls this directly
no test coverage detected