(
before: ReadonlyArray<A>,
after: ReadonlyArray<A>,
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
}
)
| 244 | * @since 4.0.6 |
| 245 | */ |
| 246 | export const diff = <A>( |
| 247 | before: ReadonlyArray<A>, |
| 248 | after: ReadonlyArray<A>, |
| 249 | options?: { |
| 250 | /** |
| 251 | * Largest number of inserted plus deleted items searched for in each |
| 252 | * changed region. Common prefixes, suffixes and matching runs are free. |
| 253 | * When a region needs more edits, the search splits it at the furthest |
| 254 | * point it reached and continues on the rest, and a part that still cannot |
| 255 | * be matched becomes a deletion followed by an insertion. The script stays |
| 256 | * valid, and is minimal whenever the whole diff needs at most `maxEdits` |
| 257 | * edits. For a finite cap, work is O((N + M) * (maxEdits + 1)). |
| 258 | * |
| 259 | * @default Infinity |
| 260 | */ |
| 261 | readonly maxEdits?: number | undefined |
| 262 | } |
| 263 | ): Array<Edit<A>> => diffWith<A>(Equal.equals)(before, after, options) |
| 264 | |
| 265 | /** |
| 266 | * Computes a minimal line-level edit script between two strings. |
nothing calls this directly
no test coverage detected