MCPcopy
hub / github.com/microsoft/vscode-js-debug / apply

Method apply

src/targets/sourceMapOverrides.ts:109–124  ·  view source on GitHub ↗

* Applies soruce map overrides to the path. The path should should given * as a filesystem path, not a URI.

(sourcePath: string)

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 5

forceForwardSlashesFunction · 0.90
properJoinFunction · 0.90
replaceMethod · 0.65
verboseMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected