@thi.ng/diff
This project is part of the
@thi.ng/umbrella monorepo.
About
Customizable diff implementations for JS arrays (sequential) & objects
(associative), with or without linear edit logs.
Installation
yarn add @thi.ng/diff
Dependencies
Usage examples
import { diffArray, DiffMode } from "@thi.ng/diff";
diffArray([1, 2, 3], [1, 2, 4], DiffMode.FULL);
Breaking changes
2.0.0
The linear edit logs of both diffArray
and diffObject
are now
returned as flat arrays, with each log entry consisting of 3 or 2
successive array items. This is to avoid allocation of various small
arrays.
The order of optional args to both functions has been swapped to:
diffArray(old, new, mode?, equiv?)
diffObject(old, new, mode?, equiv?)
Authors
License
© 2018 Karsten Schmidt // Apache Software License 2.0