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/esm/index.mjs
CHANGED
|
@@ -998,6 +998,14 @@ var IterableEntryBase = class {
|
|
|
998
998
|
}
|
|
999
999
|
return accumulator;
|
|
1000
1000
|
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Converts data structure to `[key, value]` pairs.
|
|
1003
|
+
* @returns Array of entries.
|
|
1004
|
+
* @remarks Time O(n), Space O(n)
|
|
1005
|
+
*/
|
|
1006
|
+
toArray() {
|
|
1007
|
+
return [...this];
|
|
1008
|
+
}
|
|
1001
1009
|
/**
|
|
1002
1010
|
* Visualize the iterable as an array of `[key, value]` pairs (or a custom string).
|
|
1003
1011
|
* @returns Array of entries (default) or a string.
|
|
@@ -1027,8 +1035,6 @@ var Range = class {
|
|
|
1027
1035
|
this.high = high;
|
|
1028
1036
|
this.includeLow = includeLow;
|
|
1029
1037
|
this.includeHigh = includeHigh;
|
|
1030
|
-
if (!(isComparable(low) && isComparable(high))) throw new RangeError("low or high is not comparable");
|
|
1031
|
-
if (low > high) throw new RangeError("low must be less than or equal to high");
|
|
1032
1038
|
}
|
|
1033
1039
|
static {
|
|
1034
1040
|
__name(this, "Range");
|