@calcit/ternary-tree 0.0.23 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/list.d.mts +2 -0
- package/lib/list.mjs +8 -0
- package/lib/main.mjs +2 -0
- package/package.json +4 -4
package/lib/list.d.mts
CHANGED
@@ -30,6 +30,8 @@ export declare function concat2<T>(left: TernaryTreeList<T>, middle: TernaryTree
|
|
30
30
|
export declare function concat3<T>(left: TernaryTreeList<T>, middle: TernaryTreeList<T>, right: TernaryTreeList<T>): TernaryTreeList<T>;
|
31
31
|
export declare function sameListShape<T>(xs: TernaryTreeList<T>, ys: TernaryTreeList<T>): boolean;
|
32
32
|
export declare function listEqual<T>(xs: TernaryTreeList<T>, ys: TernaryTreeList<T>): boolean;
|
33
|
+
/** in some cases we disable for performance */
|
34
|
+
export declare let disableListStructureCheck: () => void;
|
33
35
|
export declare function checkListStructure<T>(tree: TernaryTreeList<T>): boolean;
|
34
36
|
export declare function slice<T>(tree: TernaryTreeList<T>, startIdx: number, endIdx: number): TernaryTreeList<T>;
|
35
37
|
export declare function reverse<T>(tree: TernaryTreeList<T>): TernaryTreeList<T>;
|
package/lib/list.mjs
CHANGED
@@ -879,7 +879,15 @@ export function listEqual(xs, ys) {
|
|
879
879
|
}
|
880
880
|
return true;
|
881
881
|
}
|
882
|
+
var skipListStructureCheck = false;
|
883
|
+
/** in some cases we disable for performance */
|
884
|
+
export let disableListStructureCheck = () => {
|
885
|
+
skipListStructureCheck = true;
|
886
|
+
};
|
882
887
|
export function checkListStructure(tree) {
|
888
|
+
if (skipListStructureCheck) {
|
889
|
+
return true;
|
890
|
+
}
|
883
891
|
if (tree == null || listLen(tree) === 0) {
|
884
892
|
return true;
|
885
893
|
}
|
package/lib/main.mjs
CHANGED
@@ -4,6 +4,8 @@ import "./test-map.mjs";
|
|
4
4
|
import { runListTests } from "./test-list.mjs";
|
5
5
|
import { runMapTests } from "./test-map.mjs";
|
6
6
|
import { mergeValueHash, overwriteHashGenerator, valueHash } from "./types.mjs";
|
7
|
+
// import { disableListStructureCheck } from "./list.mjs";
|
8
|
+
// disableListStructureCheck();
|
7
9
|
overwriteComparator((x, y) => {
|
8
10
|
// console.log("comparing", x, y);
|
9
11
|
return deepEqual(x, y);
|
package/package.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "@calcit/ternary-tree",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.24",
|
4
4
|
"main": "./lib/index.mjs",
|
5
5
|
"scripts": {},
|
6
6
|
"devDependencies": {
|
7
|
-
"@types/node": "^20.
|
8
|
-
"prettier": "^3.
|
9
|
-
"typescript": "^5.
|
7
|
+
"@types/node": "^20.12.5",
|
8
|
+
"prettier": "^3.2.5",
|
9
|
+
"typescript": "^5.4.4"
|
10
10
|
}
|
11
11
|
}
|