(patch: string)
| 465 | } |
| 466 | |
| 467 | function countPatchStats(patch: string): { additions: number; removals: number } { |
| 468 | let additions = 0; |
| 469 | let removals = 0; |
| 470 | for (const line of patch.split("\n")) { |
| 471 | if (line.startsWith("+") && !line.startsWith("+++")) additions += 1; |
| 472 | if (line.startsWith("-") && !line.startsWith("---")) removals += 1; |
| 473 | } |
| 474 | return { additions, removals }; |
| 475 | } |