* Applies soruce map overrides to the path. The path should should given * as a filesystem path, not a URI.
(sourcePath: string)
| 107 | * as a filesystem path, not a URI. |
| 108 | */ |
| 109 | public apply(sourcePath: string): string { |
| 110 | const sourcePathWithForwardSlashes = forceForwardSlashes(sourcePath); |
| 111 | for (const [re, replacement] of this.replacers) { |
| 112 | const mappedPath = sourcePathWithForwardSlashes.replace(re, replacement); |
| 113 | if (mappedPath !== sourcePathWithForwardSlashes) { |
| 114 | this.logger.verbose( |
| 115 | LogTag.RuntimeSourceMap, |
| 116 | `SourceMap: mapping ${sourcePath} => ${mappedPath}, via sourceMapPathOverrides entry - ${re.toString()}`, |
| 117 | ); |
| 118 | |
| 119 | return properJoin(mappedPath); // normalization, see #401 |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | return sourcePath; |
| 124 | } |
| 125 | } |
nothing calls this directly
no test coverage detected