( oldText: string, newText: string, mode: "file" | "function" = "file", )
| 39 | * @returns A DiffResult with diff text and count of changed lines |
| 40 | */ |
| 41 | export function computeDiff( |
| 42 | oldText: string, |
| 43 | newText: string, |
| 44 | mode: "file" | "function" = "file", |
| 45 | ): DiffResult { |
| 46 | if (mode === "file") { |
| 47 | return computeFileDiff(oldText, newText); |
| 48 | } else { |
| 49 | return computeFunctionDiff(oldText, newText); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Compute a diff between two files |
no test coverage detected