(needle: string, replacement: string)
| 133 | _sanitize(value: string): string { |
| 134 | // replaces path like C:/testDir/foo/bar.js -> ${testDir}/foo/bar.js |
| 135 | const replacePath = (needle: string, replacement: string) => { |
| 136 | // Escape special chars, force paths to use forward slashes |
| 137 | const safeStr = escapeRegexSpecialChars(forceForwardSlashes(needle), '/'); |
| 138 | // Create an re that allows for any slash delimiter, and looks at the rest of the line |
| 139 | const re = new RegExp(safeStr.replace(/\//g, '[\\\\/]') + '(.*)', 'gi'); |
| 140 | |
| 141 | // Replace it with the ${replacementString} and a forward-slashed version |
| 142 | // of the rest of the line. |
| 143 | value = value.replace(re, (_match, trailing) => replacement + forceForwardSlashes(trailing)); |
| 144 | }; |
| 145 | |
| 146 | value = String(value); |
| 147 | replacePath(this._workspaceFolder, '${workspaceFolder}'); |
nothing calls this directly
no test coverage detected