(diff: string)
| 14 | * Remove non-semantic diff noise like "No newline at end of file" |
| 15 | */ |
| 16 | export function sanitizeUnifiedDiff(diff: string): string { |
| 17 | if (!diff) return diff |
| 18 | return diff.replace(/\r\n/g, "\n").replace(/(^|\n)[ \t]*(?:\\ )?No newline at end of file[ \t]*(?=\n|$)/gi, "$1") |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * Compute +/− counts from a unified diff (ignores headers/hunk lines) |
no test coverage detected