UNPKG

fast-array-diff

Version:

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

10 lines (9 loc) 275 B
import * as patch from './patch'; export type ApplyItem<T> = patch.PatchItem<T> | { type: 'remove'; oldPos: number; newPos: number; length: number; }; export type Apply<T> = ApplyItem<T>[]; export declare function applyPatch<T>(a: T[], patch: Apply<T>): T[];