( oldLines: string[], newLines: string[], )
| 19 | }; |
| 20 | |
| 21 | async function collectDiffs( |
| 22 | oldLines: string[], |
| 23 | newLines: string[], |
| 24 | ): Promise<{ streamDiffs: DiffLine[]; myersDiffs: any }> { |
| 25 | const streamDiffs: DiffLine[] = []; |
| 26 | |
| 27 | for await (const diffLine of streamDiff(oldLines, generateLines(newLines))) { |
| 28 | streamDiffs.push(diffLine); |
| 29 | } |
| 30 | |
| 31 | const myersDiffs = myersDiff(oldLines.join("\n"), newLines.join("\n")); |
| 32 | |
| 33 | return { streamDiffs, myersDiffs }; |
| 34 | } |
| 35 | |
| 36 | function getMyersDiffType(diff: any): MyersDiffTypes | undefined { |
| 37 | if (changed(diff.rhs) && !changed(diff.lhs)) { |
no test coverage detected