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