graph-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.
@@ -21,38 +21,6 @@ var arrayRemove = /* @__PURE__ */ __name(function(array, predicate) {
21
21
  }
22
22
  return result;
23
23
  }, "arrayRemove");
24
- function isPrimitiveComparable(value) {
25
- const valueType = typeof value;
26
- if (valueType === "number") return true;
27
- return valueType === "bigint" || valueType === "string" || valueType === "boolean";
28
- }
29
- __name(isPrimitiveComparable, "isPrimitiveComparable");
30
- function tryObjectToPrimitive(obj) {
31
- if (typeof obj.valueOf === "function") {
32
- const valueOfResult = obj.valueOf();
33
- if (valueOfResult !== obj) {
34
- if (isPrimitiveComparable(valueOfResult)) return valueOfResult;
35
- if (typeof valueOfResult === "object" && valueOfResult !== null) return tryObjectToPrimitive(valueOfResult);
36
- }
37
- }
38
- if (typeof obj.toString === "function") {
39
- const stringResult = obj.toString();
40
- if (stringResult !== "[object Object]") return stringResult;
41
- }
42
- return null;
43
- }
44
- __name(tryObjectToPrimitive, "tryObjectToPrimitive");
45
- function isComparable(value, isForceObjectComparable = false) {
46
- if (value === null || value === void 0) return false;
47
- if (isPrimitiveComparable(value)) return true;
48
- if (typeof value !== "object") return false;
49
- if (value instanceof Date) return true;
50
- if (isForceObjectComparable) return true;
51
- const comparableValue = tryObjectToPrimitive(value);
52
- if (comparableValue === null || comparableValue === void 0) return false;
53
- return isPrimitiveComparable(comparableValue);
54
- }
55
- __name(isComparable, "isComparable");
56
24
 
57
25
  // src/data-structures/base/iterable-entry-base.ts
58
26
  var IterableEntryBase = class {
@@ -211,6 +179,14 @@ var IterableEntryBase = class {
211
179
  }
212
180
  return accumulator;
213
181
  }
182
+ /**
183
+ * Converts data structure to `[key, value]` pairs.
184
+ * @returns Array of entries.
185
+ * @remarks Time O(n), Space O(n)
186
+ */
187
+ toArray() {
188
+ return [...this];
189
+ }
214
190
  /**
215
191
  * Visualize the iterable as an array of `[key, value]` pairs (or a custom string).
216
192
  * @returns Array of entries (default) or a string.
@@ -3252,8 +3228,6 @@ var Range = class {
3252
3228
  this.high = high;
3253
3229
  this.includeLow = includeLow;
3254
3230
  this.includeHigh = includeHigh;
3255
- if (!(isComparable(low) && isComparable(high))) throw new RangeError("low or high is not comparable");
3256
- if (low > high) throw new RangeError("low must be less than or equal to high");
3257
3231
  }
3258
3232
  static {
3259
3233
  __name(this, "Range");