* @param {string} str str * @returns {string} str without cwd
(str)
| 3 | * @returns {string} str without cwd |
| 4 | */ |
| 5 | function removeCWD(str) { |
| 6 | const isWin = process.platform === "win32"; |
| 7 | let cwd = process.cwd(); |
| 8 | |
| 9 | if (isWin) { |
| 10 | str = str.replaceAll("\\", "/"); |
| 11 | |
| 12 | cwd = cwd.replaceAll("\\", "/"); |
| 13 | } |
| 14 | |
| 15 | return str |
| 16 | .replace(/\(from .*?\)/, "(from `replaced original path`)") |
| 17 | .replaceAll(new RegExp(cwd, "g"), ""); |
| 18 | } |
| 19 | |
| 20 | export default (errors) => |
| 21 | errors.map((error) => |
no outgoing calls
no test coverage detected
searching dependent graphs…