(
oldContent: string,
newContent: string,
filePath: string,
options: Partial<ParseOptions> = {},
)
| 343 | } |
| 344 | |
| 345 | export function createDiff( |
| 346 | oldContent: string, |
| 347 | newContent: string, |
| 348 | filePath: string, |
| 349 | options: Partial<ParseOptions> = {}, |
| 350 | ): FileDiff | null { |
| 351 | const diffText = createTwoFilesPatch( |
| 352 | `a/${filePath}`, |
| 353 | `b/${filePath}`, |
| 354 | oldContent, |
| 355 | newContent, |
| 356 | '', |
| 357 | '', |
| 358 | { context: 3 }, |
| 359 | ) |
| 360 | |
| 361 | const files = parseUnifiedDiff(diffText, options) |
| 362 | return files[0] ?? null |
| 363 | } |
| 364 | |
| 365 | export function countDiffStats(hunks: (DiffHunk | DiffSkipBlock)[]): { |
| 366 | additions: number |
no test coverage detected