@thi.ng/diff
Advanced tools
Comparing version 5.1.68 to 5.1.69
# Change Log | ||
- **Last updated**: 2024-04-23T07:02:18Z | ||
- **Last updated**: 2024-05-08T18:24:31Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -5,0 +5,0 @@ |
import { equiv } from "@thi.ng/equiv"; | ||
const diffObject = (a, b, mode = "full", _equiv = equiv) => a === b ? { distance: 0 } : mode === "only-distance" ? diffObjectDist(a, b, _equiv) : diffObjectFull(a, b, _equiv); | ||
const diffObjectDist = (a, b, _equiv) => { | ||
if (!a) | ||
a = {}; | ||
if (!b) | ||
b = {}; | ||
if (!a) a = {}; | ||
if (!b) b = {}; | ||
let d = 0; | ||
@@ -19,6 +17,4 @@ for (let k in a) { | ||
const diffObjectFull = (a, b, _equiv) => { | ||
if (!a) | ||
a = {}; | ||
if (!b) | ||
b = {}; | ||
if (!a) a = {}; | ||
if (!b) b = {}; | ||
let d = 0; | ||
@@ -25,0 +21,0 @@ const adds = []; |
{ | ||
"name": "@thi.ng/diff", | ||
"version": "5.1.68", | ||
"version": "5.1.69", | ||
"description": "Customizable diff implementations for arrays (sequential) & objects (associative), with or without linear edit logs", | ||
@@ -39,9 +39,9 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.11.1", | ||
"@thi.ng/equiv": "^2.1.57" | ||
"@thi.ng/api": "^8.11.2", | ||
"@thi.ng/equiv": "^2.1.58" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.43.0", | ||
"typedoc": "^0.25.12", | ||
"typescript": "^5.4.3" | ||
"@microsoft/api-extractor": "^7.43.2", | ||
"typedoc": "^0.25.13", | ||
"typescript": "^5.4.5" | ||
}, | ||
@@ -79,3 +79,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "5dd66c18a3862a3af69a5b2f49563f7cbdd960c2\n" | ||
"gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n" | ||
} |
33203
282
Updated@thi.ng/api@^8.11.2
Updated@thi.ng/equiv@^2.1.58