linked-list-typed 2.2.5 → 2.2.7
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 +0 -36
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs-legacy/index.cjs +0 -36
- package/dist/cjs-legacy/index.cjs.map +1 -1
- package/dist/esm/index.mjs +0 -36
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm-legacy/index.mjs +0 -36
- 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/linked-list-typed.js +0 -33
- package/dist/umd/linked-list-typed.js.map +1 -1
- package/dist/umd/linked-list-typed.min.js +1 -1
- package/dist/umd/linked-list-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
|
@@ -2078,40 +2078,6 @@ var SkipList = class {
|
|
|
2078
2078
|
}
|
|
2079
2079
|
};
|
|
2080
2080
|
|
|
2081
|
-
// src/utils/utils.ts
|
|
2082
|
-
function isPrimitiveComparable(value) {
|
|
2083
|
-
const valueType = typeof value;
|
|
2084
|
-
if (valueType === "number") return true;
|
|
2085
|
-
return valueType === "bigint" || valueType === "string" || valueType === "boolean";
|
|
2086
|
-
}
|
|
2087
|
-
__name(isPrimitiveComparable, "isPrimitiveComparable");
|
|
2088
|
-
function tryObjectToPrimitive(obj) {
|
|
2089
|
-
if (typeof obj.valueOf === "function") {
|
|
2090
|
-
const valueOfResult = obj.valueOf();
|
|
2091
|
-
if (valueOfResult !== obj) {
|
|
2092
|
-
if (isPrimitiveComparable(valueOfResult)) return valueOfResult;
|
|
2093
|
-
if (typeof valueOfResult === "object" && valueOfResult !== null) return tryObjectToPrimitive(valueOfResult);
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2096
|
-
if (typeof obj.toString === "function") {
|
|
2097
|
-
const stringResult = obj.toString();
|
|
2098
|
-
if (stringResult !== "[object Object]") return stringResult;
|
|
2099
|
-
}
|
|
2100
|
-
return null;
|
|
2101
|
-
}
|
|
2102
|
-
__name(tryObjectToPrimitive, "tryObjectToPrimitive");
|
|
2103
|
-
function isComparable(value, isForceObjectComparable = false) {
|
|
2104
|
-
if (value === null || value === void 0) return false;
|
|
2105
|
-
if (isPrimitiveComparable(value)) return true;
|
|
2106
|
-
if (typeof value !== "object") return false;
|
|
2107
|
-
if (value instanceof Date) return true;
|
|
2108
|
-
if (isForceObjectComparable) return true;
|
|
2109
|
-
const comparableValue = tryObjectToPrimitive(value);
|
|
2110
|
-
if (comparableValue === null || comparableValue === void 0) return false;
|
|
2111
|
-
return isPrimitiveComparable(comparableValue);
|
|
2112
|
-
}
|
|
2113
|
-
__name(isComparable, "isComparable");
|
|
2114
|
-
|
|
2115
2081
|
// src/common/index.ts
|
|
2116
2082
|
var DFSOperation = /* @__PURE__ */ ((DFSOperation2) => {
|
|
2117
2083
|
DFSOperation2[DFSOperation2["VISIT"] = 0] = "VISIT";
|
|
@@ -2124,8 +2090,6 @@ var Range = class {
|
|
|
2124
2090
|
this.high = high;
|
|
2125
2091
|
this.includeLow = includeLow;
|
|
2126
2092
|
this.includeHigh = includeHigh;
|
|
2127
|
-
if (!(isComparable(low) && isComparable(high))) throw new RangeError("low or high is not comparable");
|
|
2128
|
-
if (low > high) throw new RangeError("low must be less than or equal to high");
|
|
2129
2093
|
}
|
|
2130
2094
|
static {
|
|
2131
2095
|
__name(this, "Range");
|