UNPKG

fast-array-diff

Version:

Implementation of paper 'An O(ND) Difference Algorithm and Its Variations' on array

9 lines (8 loc) 261 B
export interface PatchItem<T> { type: 'add' | 'remove'; oldPos: number; newPos: number; items: T[]; } export type Patch<T> = PatchItem<T>[]; export declare function getPatch<T>(a: T[], b: T[], compareFunc?: (ia: T, ib: T) => boolean): Patch<T>;