Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
@thi.ng/diff
Advanced tools
Customizable diff implementations for arrays (sequential) & objects (associative), with or without linear edit logs
This project is part of the @thi.ng/umbrella monorepo.
Customizable diff implementations for arrays (sequential) & objects (associative), with or without linear edit logs.
STABLE - used in production
yarn add @thi.ng/diff
Package sizes (gzipped): ESM: 1.22 KB / CJS: 1.27 KB / UMD: 1.30 KB
import { diffArray, DiffMode } from "@thi.ng/diff";
diffArray([1, 2, 3], [1, 2, 4], DiffMode.FULL);
// {
// distance: 2,
// adds: { 2: 4 },
// dels: { 2: 3 },
// const: { 0: 1, 1: 2 },
// linear: [0, 0, 1, 0, 1, 2, -1, 2, 3, 1, 2, 4]
// }
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?)
Karsten Schmidt
© 2016 - 2020 Karsten Schmidt // Apache Software License 2.0
FAQs
Customizable diff implementations for arrays (sequential) & objects (associative), with or without linear edit logs
The npm package @thi.ng/diff receives a total of 266 weekly downloads. As such, @thi.ng/diff popularity was classified as not popular.
We found that @thi.ng/diff demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.