(path: string, newContent: string)
| 1388 | } |
| 1389 | |
| 1390 | async diffContent(path: string, newContent: string): Promise<string> { |
| 1391 | const existing = await this.readFile(path); |
| 1392 | if (existing === null) throw new Error(`ENOENT: no such file: ${path}`); |
| 1393 | const linesA = existing.split("\n").length; |
| 1394 | const linesB = newContent.split("\n").length; |
| 1395 | if (linesA > MAX_DIFF_LINES || linesB > MAX_DIFF_LINES) { |
| 1396 | throw new Error( |
| 1397 | `EFBIG: content too large for diff (max ${MAX_DIFF_LINES} lines)` |
| 1398 | ); |
| 1399 | } |
| 1400 | const normalized = normalizePath(path); |
| 1401 | return unifiedDiff(existing, newContent, normalized, normalized); |
| 1402 | } |
| 1403 | |
| 1404 | // ── Info ──────────────────────────────────────────────────────── |
| 1405 |
nothing calls this directly
no test coverage detected