@thi.ng/diff
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -7,2 +7,1 @@ export var DiffMode; | ||
})(DiffMode || (DiffMode = {})); | ||
; |
18
array.js
@@ -6,8 +6,8 @@ import { equiv as _equiv } from "@thi.ng/equiv"; | ||
let _cachedPathPos = []; | ||
const cachedFP = (size) => _cachedFP && _cachedFP.length >= size ? | ||
_cachedFP : | ||
(_cachedFP = new Int32Array(size)); | ||
const cachedPath = (size) => _cachedPath && _cachedPath.length >= size ? | ||
_cachedPath : | ||
(_cachedPath = new Int32Array(size)); | ||
const cachedFP = (size) => _cachedFP && _cachedFP.length >= size | ||
? _cachedFP | ||
: (_cachedFP = new Int32Array(size)); | ||
const cachedPath = (size) => _cachedPath && _cachedPath.length >= size | ||
? _cachedPath | ||
: (_cachedPath = new Int32Array(size)); | ||
const simpleDiff = (state, src, key, logDir, mode) => { | ||
@@ -158,11 +158,11 @@ const n = src.length; | ||
if (d > dp) { | ||
linear.push(aID, py, adds[py] = b[py]); | ||
linear.push(aID, py, (adds[py] = b[py])); | ||
py++; | ||
} | ||
else if (d < dp) { | ||
linear.push(dID, px, dels[px] = a[px]); | ||
linear.push(dID, px, (dels[px] = a[px])); | ||
px++; | ||
} | ||
else { | ||
linear.push(0, px, _const[px] = a[px]); | ||
linear.push(0, px, (_const[px] = a[px])); | ||
px++; | ||
@@ -169,0 +169,0 @@ py++; |
@@ -6,2 +6,10 @@ # Change Log | ||
## [3.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.0.2...@thi.ng/diff@3.0.3) (2019-03-01) | ||
**Note:** Version bump only for package @thi.ng/diff | ||
## [3.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/diff@3.0.1...@thi.ng/diff@3.0.2) (2019-02-05) | ||
@@ -8,0 +16,0 @@ |
@@ -17,8 +17,8 @@ 'use strict'; | ||
let _cachedPathPos = []; | ||
const cachedFP = (size) => _cachedFP && _cachedFP.length >= size ? | ||
_cachedFP : | ||
(_cachedFP = new Int32Array(size)); | ||
const cachedPath = (size) => _cachedPath && _cachedPath.length >= size ? | ||
_cachedPath : | ||
(_cachedPath = new Int32Array(size)); | ||
const cachedFP = (size) => _cachedFP && _cachedFP.length >= size | ||
? _cachedFP | ||
: (_cachedFP = new Int32Array(size)); | ||
const cachedPath = (size) => _cachedPath && _cachedPath.length >= size | ||
? _cachedPath | ||
: (_cachedPath = new Int32Array(size)); | ||
const simpleDiff = (state, src, key, logDir, mode) => { | ||
@@ -154,11 +154,11 @@ const n = src.length; | ||
if (d > dp) { | ||
linear.push(aID, py, adds[py] = b[py]); | ||
linear.push(aID, py, (adds[py] = b[py])); | ||
py++; | ||
} | ||
else if (d < dp) { | ||
linear.push(dID, px, dels[px] = a[px]); | ||
linear.push(dID, px, (dels[px] = a[px])); | ||
px++; | ||
} | ||
else { | ||
linear.push(0, px, _const[px] = a[px]); | ||
linear.push(0, px, (_const[px] = a[px])); | ||
px++; | ||
@@ -199,7 +199,7 @@ py++; | ||
const diffObject = (a, b, mode = 2 , _equiv = equiv.equiv) => a === b ? | ||
{ distance: 0 } : | ||
mode === 0 ? | ||
diffObjectDist(a, b, _equiv) : | ||
diffObjectFull(a, b, _equiv); | ||
const diffObject = (a, b, mode = 2 , _equiv = equiv.equiv) => a === b | ||
? { distance: 0 } | ||
: mode === 0 | ||
? diffObjectDist(a, b, _equiv) | ||
: diffObjectFull(a, b, _equiv); | ||
const diffObjectDist = (a, b, _equiv) => { | ||
@@ -206,0 +206,0 @@ let d = 0; |
@@ -17,8 +17,8 @@ (function (global, factory) { | ||
let _cachedPathPos = []; | ||
const cachedFP = (size) => _cachedFP && _cachedFP.length >= size ? | ||
_cachedFP : | ||
(_cachedFP = new Int32Array(size)); | ||
const cachedPath = (size) => _cachedPath && _cachedPath.length >= size ? | ||
_cachedPath : | ||
(_cachedPath = new Int32Array(size)); | ||
const cachedFP = (size) => _cachedFP && _cachedFP.length >= size | ||
? _cachedFP | ||
: (_cachedFP = new Int32Array(size)); | ||
const cachedPath = (size) => _cachedPath && _cachedPath.length >= size | ||
? _cachedPath | ||
: (_cachedPath = new Int32Array(size)); | ||
const simpleDiff = (state, src, key, logDir, mode) => { | ||
@@ -154,11 +154,11 @@ const n = src.length; | ||
if (d > dp) { | ||
linear.push(aID, py, adds[py] = b[py]); | ||
linear.push(aID, py, (adds[py] = b[py])); | ||
py++; | ||
} | ||
else if (d < dp) { | ||
linear.push(dID, px, dels[px] = a[px]); | ||
linear.push(dID, px, (dels[px] = a[px])); | ||
px++; | ||
} | ||
else { | ||
linear.push(0, px, _const[px] = a[px]); | ||
linear.push(0, px, (_const[px] = a[px])); | ||
px++; | ||
@@ -199,7 +199,7 @@ py++; | ||
const diffObject = (a, b, mode = 2 , _equiv = equiv.equiv) => a === b ? | ||
{ distance: 0 } : | ||
mode === 0 ? | ||
diffObjectDist(a, b, _equiv) : | ||
diffObjectFull(a, b, _equiv); | ||
const diffObject = (a, b, mode = 2 , _equiv = equiv.equiv) => a === b | ||
? { distance: 0 } | ||
: mode === 0 | ||
? diffObjectDist(a, b, _equiv) | ||
: diffObjectFull(a, b, _equiv); | ||
const diffObjectDist = (a, b, _equiv) => { | ||
@@ -206,0 +206,0 @@ let d = 0; |
import { equiv } from "@thi.ng/equiv"; | ||
export const diffObject = (a, b, mode = 2 /* FULL */, _equiv = equiv) => a === b ? | ||
{ distance: 0 } : | ||
mode === 0 /* ONLY_DISTANCE */ ? | ||
diffObjectDist(a, b, _equiv) : | ||
diffObjectFull(a, b, _equiv); | ||
export const diffObject = (a, b, mode = 2 /* FULL */, _equiv = equiv) => a === b | ||
? { distance: 0 } | ||
: mode === 0 /* ONLY_DISTANCE */ | ||
? diffObjectDist(a, b, _equiv) | ||
: diffObjectFull(a, b, _equiv); | ||
const diffObjectDist = (a, b, _equiv) => { | ||
@@ -8,0 +8,0 @@ let d = 0; |
{ | ||
"name": "@thi.ng/diff", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Array & object Diff", | ||
@@ -34,4 +34,4 @@ "module": "./index.js", | ||
"dependencies": { | ||
"@thi.ng/api": "^5.0.2", | ||
"@thi.ng/equiv": "^1.0.2" | ||
"@thi.ng/api": "^5.0.3", | ||
"@thi.ng/equiv": "^1.0.3" | ||
}, | ||
@@ -52,3 +52,3 @@ "keywords": [ | ||
"sideEffects": false, | ||
"gitHead": "74fb4d83013785ce7a95357c565426a046657e74" | ||
"gitHead": "e43f57c7554fd78380bba58d37ae62ca01221eeb" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
330646
762
Updated@thi.ng/api@^5.0.3
Updated@thi.ng/equiv@^1.0.3