(str)
| 33 | * @returns {string} normalized string |
| 34 | */ |
| 35 | const normalize = (str) => { |
| 36 | if (cwd.startsWith("/")) { |
| 37 | str = str.replace(new RegExp(quoteMeta(cwd), "g"), "<cwd>"); |
| 38 | } else { |
| 39 | str = str.replace(cwdRegExp, (m, g) => `<cwd>${g.replace(/\\/g, "/")}`); |
| 40 | str = str.replace( |
| 41 | escapedCwdRegExp, |
| 42 | (m, g) => `<cwd>${g.replace(/\\\\/g, "/")}` |
| 43 | ); |
| 44 | } |
| 45 | str = str.replace(/@@ -\d+,\d+ \+\d+,\d+ @@/g, "@@ ... @@"); |
| 46 | return str; |
| 47 | }; |
| 48 | |
| 49 | class Diff { |
| 50 | /** |