(before: string, after: string, options?: {
/**
* Largest number of inserted plus deleted items searched for in each
* changed region. Common prefixes, suffixes and matching runs are free.
* When a region needs more edits, the search splits it at the furthest
* point it reached and continues on the rest, and a part that still cannot
* be matched becomes a deletion followed by an insertion. The script stays
* valid, and is minimal whenever the whole diff needs at most `maxEdits`
* edits. For a finite cap, work is O((N + M) * (maxEdits + 1)).
*
* @default Infinity
*/
readonly maxEdits?: number | undefined
})
| 291 | * @since 4.0.6 |
| 292 | */ |
| 293 | export const lines = (before: string, after: string, options?: { |
| 294 | /** |
| 295 | * Largest number of inserted plus deleted items searched for in each |
| 296 | * changed region. Common prefixes, suffixes and matching runs are free. |
| 297 | * When a region needs more edits, the search splits it at the furthest |
| 298 | * point it reached and continues on the rest, and a part that still cannot |
| 299 | * be matched becomes a deletion followed by an insertion. The script stays |
| 300 | * valid, and is minimal whenever the whole diff needs at most `maxEdits` |
| 301 | * edits. For a finite cap, work is O((N + M) * (maxEdits + 1)). |
| 302 | * |
| 303 | * @default Infinity |
| 304 | */ |
| 305 | readonly maxEdits?: number | undefined |
| 306 | }): Array<Edit<string>> => diffStrings(splitLines(before), splitLines(after), options?.maxEdits) |
| 307 | |
| 308 | /** |
| 309 | * Computes a minimal code point edit script between two strings. |
no test coverage detected