binary-tree-typed 2.2.5 → 2.2.6
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/dist/cjs/index.cjs +8 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs-legacy/index.cjs +8 -2
- package/dist/cjs-legacy/index.cjs.map +1 -1
- package/dist/esm/index.mjs +8 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm-legacy/index.mjs +8 -2
- package/dist/esm-legacy/index.mjs.map +1 -1
- package/dist/types/data-structures/base/iterable-entry-base.d.ts +6 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +14 -57
- package/dist/types/data-structures/binary-tree/bst.d.ts +46 -126
- package/dist/umd/binary-tree-typed.js +8 -2
- package/dist/umd/binary-tree-typed.js.map +1 -1
- package/dist/umd/binary-tree-typed.min.js +3 -3
- package/dist/umd/binary-tree-typed.min.js.map +1 -1
- package/package.json +2 -2
- package/src/common/index.ts +2 -4
- package/src/data-structures/base/iterable-entry-base.ts +9 -0
- package/src/data-structures/binary-tree/binary-tree.ts +67 -0
- package/src/data-structures/binary-tree/bst.ts +295 -89
package/dist/cjs/index.cjs
CHANGED
|
@@ -1000,6 +1000,14 @@ var IterableEntryBase = class {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
return accumulator;
|
|
1002
1002
|
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Converts data structure to `[key, value]` pairs.
|
|
1005
|
+
* @returns Array of entries.
|
|
1006
|
+
* @remarks Time O(n), Space O(n)
|
|
1007
|
+
*/
|
|
1008
|
+
toArray() {
|
|
1009
|
+
return [...this];
|
|
1010
|
+
}
|
|
1003
1011
|
/**
|
|
1004
1012
|
* Visualize the iterable as an array of `[key, value]` pairs (or a custom string).
|
|
1005
1013
|
* @returns Array of entries (default) or a string.
|
|
@@ -1029,8 +1037,6 @@ var Range = class {
|
|
|
1029
1037
|
this.high = high;
|
|
1030
1038
|
this.includeLow = includeLow;
|
|
1031
1039
|
this.includeHigh = includeHigh;
|
|
1032
|
-
if (!(isComparable(low) && isComparable(high))) throw new RangeError("low or high is not comparable");
|
|
1033
|
-
if (low > high) throw new RangeError("low must be less than or equal to high");
|
|
1034
1040
|
}
|
|
1035
1041
|
static {
|
|
1036
1042
|
__name(this, "Range");
|