data-structure-typed 2.5.1 → 2.5.2

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.
Files changed (172) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/README.md +75 -17
  3. package/dist/cjs/binary-tree.cjs +2723 -139
  4. package/dist/cjs/graph.cjs +192 -6
  5. package/dist/cjs/hash.cjs +63 -15
  6. package/dist/cjs/heap.cjs +93 -31
  7. package/dist/cjs/index.cjs +3514 -379
  8. package/dist/cjs/linked-list.cjs +237 -31
  9. package/dist/cjs/matrix.cjs +47 -9
  10. package/dist/cjs/priority-queue.cjs +92 -30
  11. package/dist/cjs/queue.cjs +176 -2
  12. package/dist/cjs/stack.cjs +48 -2
  13. package/dist/cjs/trie.cjs +78 -28
  14. package/dist/cjs-legacy/binary-tree.cjs +2725 -136
  15. package/dist/cjs-legacy/graph.cjs +192 -6
  16. package/dist/cjs-legacy/hash.cjs +63 -15
  17. package/dist/cjs-legacy/heap.cjs +93 -31
  18. package/dist/cjs-legacy/index.cjs +3389 -249
  19. package/dist/cjs-legacy/linked-list.cjs +237 -31
  20. package/dist/cjs-legacy/matrix.cjs +47 -9
  21. package/dist/cjs-legacy/priority-queue.cjs +92 -30
  22. package/dist/cjs-legacy/queue.cjs +176 -2
  23. package/dist/cjs-legacy/stack.cjs +48 -2
  24. package/dist/cjs-legacy/trie.cjs +78 -28
  25. package/dist/esm/binary-tree.mjs +2723 -139
  26. package/dist/esm/graph.mjs +192 -6
  27. package/dist/esm/hash.mjs +63 -15
  28. package/dist/esm/heap.mjs +93 -31
  29. package/dist/esm/index.mjs +3514 -380
  30. package/dist/esm/linked-list.mjs +237 -31
  31. package/dist/esm/matrix.mjs +47 -9
  32. package/dist/esm/priority-queue.mjs +92 -30
  33. package/dist/esm/queue.mjs +176 -2
  34. package/dist/esm/stack.mjs +48 -2
  35. package/dist/esm/trie.mjs +78 -28
  36. package/dist/esm-legacy/binary-tree.mjs +2725 -136
  37. package/dist/esm-legacy/graph.mjs +192 -6
  38. package/dist/esm-legacy/hash.mjs +63 -15
  39. package/dist/esm-legacy/heap.mjs +93 -31
  40. package/dist/esm-legacy/index.mjs +3389 -250
  41. package/dist/esm-legacy/linked-list.mjs +237 -31
  42. package/dist/esm-legacy/matrix.mjs +47 -9
  43. package/dist/esm-legacy/priority-queue.mjs +92 -30
  44. package/dist/esm-legacy/queue.mjs +176 -2
  45. package/dist/esm-legacy/stack.mjs +48 -2
  46. package/dist/esm-legacy/trie.mjs +78 -28
  47. package/dist/types/common/error.d.ts +9 -0
  48. package/dist/types/common/index.d.ts +1 -1
  49. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +48 -0
  50. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +56 -0
  51. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +102 -2
  52. package/dist/types/data-structures/binary-tree/bst.d.ts +195 -0
  53. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +76 -0
  54. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +24 -0
  55. package/dist/types/data-structures/binary-tree/tree-map.d.ts +528 -0
  56. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +531 -6
  57. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +435 -6
  58. package/dist/types/data-structures/binary-tree/tree-set.d.ts +505 -0
  59. package/dist/types/data-structures/graph/directed-graph.d.ts +40 -0
  60. package/dist/types/data-structures/graph/undirected-graph.d.ts +36 -0
  61. package/dist/types/data-structures/hash/hash-map.d.ts +44 -0
  62. package/dist/types/data-structures/heap/heap.d.ts +56 -0
  63. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +68 -0
  64. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +60 -0
  65. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +72 -0
  66. package/dist/types/data-structures/matrix/matrix.d.ts +32 -0
  67. package/dist/types/data-structures/queue/deque.d.ts +60 -0
  68. package/dist/types/data-structures/queue/queue.d.ts +48 -0
  69. package/dist/types/data-structures/stack/stack.d.ts +40 -0
  70. package/dist/types/data-structures/trie/trie.d.ts +48 -0
  71. package/dist/types/types/data-structures/binary-tree/bst.d.ts +1 -0
  72. package/dist/types/types/data-structures/binary-tree/tree-map.d.ts +5 -0
  73. package/dist/types/types/data-structures/binary-tree/tree-multi-set.d.ts +4 -0
  74. package/dist/types/types/data-structures/binary-tree/tree-set.d.ts +4 -0
  75. package/dist/umd/data-structure-typed.js +3404 -265
  76. package/dist/umd/data-structure-typed.min.js +5 -5
  77. package/docs-site-docusaurus/docs/api/classes/AVLTree.md +650 -136
  78. package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +11 -11
  79. package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +71 -71
  80. package/docs-site-docusaurus/docs/api/classes/BST.md +591 -129
  81. package/docs-site-docusaurus/docs/api/classes/BSTNode.md +13 -13
  82. package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +15 -15
  83. package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +107 -107
  84. package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
  85. package/docs-site-docusaurus/docs/api/classes/Deque.md +82 -82
  86. package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +82 -82
  87. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +74 -74
  88. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +8 -8
  89. package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
  90. package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
  91. package/docs-site-docusaurus/docs/api/classes/HashMap.md +47 -47
  92. package/docs-site-docusaurus/docs/api/classes/Heap.md +45 -45
  93. package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +25 -25
  94. package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +33 -33
  95. package/docs-site-docusaurus/docs/api/classes/LinearBase.md +50 -50
  96. package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +55 -55
  97. package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +49 -49
  98. package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +6 -6
  99. package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +78 -78
  100. package/docs-site-docusaurus/docs/api/classes/MapGraph.md +82 -82
  101. package/docs-site-docusaurus/docs/api/classes/Matrix.md +31 -31
  102. package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +45 -45
  103. package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +45 -45
  104. package/docs-site-docusaurus/docs/api/classes/MinHeap.md +45 -45
  105. package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +45 -45
  106. package/docs-site-docusaurus/docs/api/classes/Navigator.md +5 -5
  107. package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +44 -44
  108. package/docs-site-docusaurus/docs/api/classes/Queue.md +60 -60
  109. package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +660 -146
  110. package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -10
  111. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +78 -78
  112. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +6 -6
  113. package/docs-site-docusaurus/docs/api/classes/SkipList.md +44 -44
  114. package/docs-site-docusaurus/docs/api/classes/Stack.md +39 -39
  115. package/docs-site-docusaurus/docs/api/classes/TreeMap.md +165 -33
  116. package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +162 -46
  117. package/docs-site-docusaurus/docs/api/classes/TreeSet.md +161 -32
  118. package/docs-site-docusaurus/docs/api/classes/Trie.md +47 -47
  119. package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
  120. package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +81 -81
  121. package/docs-site-docusaurus/docs/guide/architecture.md +2 -0
  122. package/docs-site-docusaurus/docs/guide/concepts.md +32 -1
  123. package/docs-site-docusaurus/docs/guide/faq.md +180 -0
  124. package/docs-site-docusaurus/docs/guide/guides.md +40 -54
  125. package/docs-site-docusaurus/docs/guide/installation.md +2 -0
  126. package/docs-site-docusaurus/docs/guide/integrations.md +2 -0
  127. package/docs-site-docusaurus/docs/guide/overview.md +7 -0
  128. package/docs-site-docusaurus/docs/guide/performance.md +2 -0
  129. package/docs-site-docusaurus/docs/guide/quick-start.md +31 -0
  130. package/docs-site-docusaurus/docs/guide/use-cases/_category_.json +6 -0
  131. package/docs-site-docusaurus/docs/guide/use-cases/array-sort-alternative.md +158 -0
  132. package/docs-site-docusaurus/docs/guide/use-cases/heap-vs-sorting.md +92 -0
  133. package/docs-site-docusaurus/docs/guide/use-cases/map-vs-treemap.md +151 -0
  134. package/docs-site-docusaurus/docs/guide/use-cases/priority-queue-typescript.md +113 -0
  135. package/docs-site-docusaurus/docs/guide/use-cases/treemap-javascript.md +151 -0
  136. package/docs-site-docusaurus/docusaurus.config.ts +1 -1
  137. package/docs-site-docusaurus/src/pages/index.tsx +51 -2
  138. package/docs-site-docusaurus/static/llms.txt +37 -0
  139. package/llms.txt +37 -0
  140. package/package.json +64 -56
  141. package/src/common/error.ts +19 -1
  142. package/src/common/index.ts +1 -1
  143. package/src/data-structures/base/iterable-element-base.ts +3 -2
  144. package/src/data-structures/binary-tree/avl-tree.ts +47 -0
  145. package/src/data-structures/binary-tree/binary-indexed-tree.ts +46 -4
  146. package/src/data-structures/binary-tree/binary-tree.ts +79 -4
  147. package/src/data-structures/binary-tree/bst.ts +441 -6
  148. package/src/data-structures/binary-tree/red-black-tree.ts +73 -0
  149. package/src/data-structures/binary-tree/segment-tree.ts +18 -0
  150. package/src/data-structures/binary-tree/tree-map.ts +434 -9
  151. package/src/data-structures/binary-tree/tree-multi-map.ts +426 -5
  152. package/src/data-structures/binary-tree/tree-multi-set.ts +350 -6
  153. package/src/data-structures/binary-tree/tree-set.ts +410 -8
  154. package/src/data-structures/graph/abstract-graph.ts +2 -2
  155. package/src/data-structures/graph/directed-graph.ts +30 -0
  156. package/src/data-structures/graph/undirected-graph.ts +27 -0
  157. package/src/data-structures/hash/hash-map.ts +35 -4
  158. package/src/data-structures/heap/heap.ts +46 -4
  159. package/src/data-structures/heap/max-heap.ts +2 -2
  160. package/src/data-structures/linked-list/doubly-linked-list.ts +51 -0
  161. package/src/data-structures/linked-list/singly-linked-list.ts +45 -0
  162. package/src/data-structures/linked-list/skip-linked-list.ts +59 -5
  163. package/src/data-structures/matrix/matrix.ts +33 -9
  164. package/src/data-structures/priority-queue/max-priority-queue.ts +2 -2
  165. package/src/data-structures/queue/deque.ts +45 -0
  166. package/src/data-structures/queue/queue.ts +36 -0
  167. package/src/data-structures/stack/stack.ts +30 -0
  168. package/src/data-structures/trie/trie.ts +38 -2
  169. package/src/types/data-structures/binary-tree/bst.ts +1 -0
  170. package/src/types/data-structures/binary-tree/tree-map.ts +6 -0
  171. package/src/types/data-structures/binary-tree/tree-multi-set.ts +5 -0
  172. package/src/types/data-structures/binary-tree/tree-set.ts +5 -0
@@ -12,6 +12,37 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
12
12
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
13
13
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
14
14
 
15
+ // src/common/error.ts
16
+ function raise(ErrorClass, message) {
17
+ throw new ErrorClass(message);
18
+ }
19
+ __name(raise, "raise");
20
+ var ERR = {
21
+ // Range / index
22
+ indexOutOfRange: /* @__PURE__ */ __name((index, min, max, ctx) => `${ctx ? ctx + ": " : ""}Index ${index} is out of range [${min}, ${max}].`, "indexOutOfRange"),
23
+ invalidIndex: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}Index must be an integer.`, "invalidIndex"),
24
+ // Type / argument
25
+ invalidArgument: /* @__PURE__ */ __name((reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`, "invalidArgument"),
26
+ comparatorRequired: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}Comparator is required for non-number/non-string/non-Date keys.`, "comparatorRequired"),
27
+ invalidKey: /* @__PURE__ */ __name((reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`, "invalidKey"),
28
+ notAFunction: /* @__PURE__ */ __name((name, ctx) => `${ctx ? ctx + ": " : ""}${name} must be a function.`, "notAFunction"),
29
+ invalidEntry: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}Each entry must be a [key, value] tuple.`, "invalidEntry"),
30
+ invalidNaN: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}NaN is not a valid key.`, "invalidNaN"),
31
+ invalidDate: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}Invalid Date key.`, "invalidDate"),
32
+ reduceEmpty: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}Reduce of empty structure with no initial value.`, "reduceEmpty"),
33
+ callbackReturnType: /* @__PURE__ */ __name((expected, got, ctx) => `${ctx ? ctx + ": " : ""}Callback must return ${expected}; got ${got}.`, "callbackReturnType"),
34
+ // State / operation
35
+ invalidOperation: /* @__PURE__ */ __name((reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`, "invalidOperation"),
36
+ // Matrix
37
+ matrixDimensionMismatch: /* @__PURE__ */ __name((op) => `Matrix: Dimensions must be compatible for ${op}.`, "matrixDimensionMismatch"),
38
+ matrixSingular: /* @__PURE__ */ __name(() => "Matrix: Singular matrix, inverse does not exist.", "matrixSingular"),
39
+ matrixNotSquare: /* @__PURE__ */ __name(() => "Matrix: Must be square for inversion.", "matrixNotSquare"),
40
+ matrixNotRectangular: /* @__PURE__ */ __name(() => "Matrix: Must be rectangular for transposition.", "matrixNotRectangular"),
41
+ matrixRowMismatch: /* @__PURE__ */ __name((expected, got) => `Matrix: Expected row length ${expected}, but got ${got}.`, "matrixRowMismatch"),
42
+ // Order statistic
43
+ orderStatisticNotEnabled: /* @__PURE__ */ __name((method, ctx) => `${ctx ? ctx + ": " : ""}${method}() requires enableOrderStatistic: true.`, "orderStatisticNotEnabled")
44
+ };
45
+
15
46
  // src/data-structures/base/iterable-element-base.ts
16
47
  var _IterableElementBase = class _IterableElementBase {
17
48
  /**
@@ -34,7 +65,7 @@ var _IterableElementBase = class _IterableElementBase {
34
65
  if (options) {
35
66
  const { toElementFn } = options;
36
67
  if (typeof toElementFn === "function") this._toElementFn = toElementFn;
37
- else if (toElementFn) throw new TypeError("toElementFn must be a function type");
68
+ else if (toElementFn) raise(TypeError, "toElementFn must be a function type");
38
69
  }
39
70
  }
40
71
  /**
@@ -190,7 +221,7 @@ var _IterableElementBase = class _IterableElementBase {
190
221
  acc = initialValue;
191
222
  } else {
192
223
  const first = iter.next();
193
- if (first.done) throw new TypeError("Reduce of empty structure with no initial value");
224
+ if (first.done) raise(TypeError, "Reduce of empty structure with no initial value");
194
225
  acc = first.value;
195
226
  index = 1;
196
227
  }
@@ -758,6 +789,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
758
789
 
759
790
 
760
791
 
792
+
793
+
794
+
795
+
761
796
 
762
797
 
763
798
 
@@ -821,6 +856,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
821
856
 
822
857
 
823
858
 
859
+
860
+
861
+
862
+
824
863
 
825
864
 
826
865
 
@@ -890,6 +929,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
890
929
 
891
930
 
892
931
 
932
+
933
+
934
+
935
+
893
936
 
894
937
 
895
938
 
@@ -940,6 +983,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
940
983
 
941
984
 
942
985
 
986
+
987
+
988
+
989
+
943
990
 
944
991
 
945
992
 
@@ -1051,6 +1098,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
1051
1098
 
1052
1099
 
1053
1100
 
1101
+
1102
+
1103
+
1104
+
1054
1105
 
1055
1106
 
1056
1107
 
@@ -1106,6 +1157,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
1106
1157
 
1107
1158
 
1108
1159
 
1160
+
1161
+
1162
+
1163
+
1109
1164
 
1110
1165
 
1111
1166
 
@@ -1150,6 +1205,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
1150
1205
 
1151
1206
 
1152
1207
 
1208
+
1209
+
1210
+
1211
+
1153
1212
 
1154
1213
 
1155
1214
 
@@ -1200,6 +1259,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
1200
1259
 
1201
1260
 
1202
1261
 
1262
+
1263
+
1264
+
1265
+
1203
1266
 
1204
1267
 
1205
1268
 
@@ -1255,6 +1318,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
1255
1318
 
1256
1319
 
1257
1320
 
1321
+
1322
+
1323
+
1324
+
1258
1325
 
1259
1326
 
1260
1327
 
@@ -1318,6 +1385,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
1318
1385
 
1319
1386
 
1320
1387
 
1388
+
1389
+
1390
+
1391
+
1321
1392
 
1322
1393
 
1323
1394
 
@@ -1358,6 +1429,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
1358
1429
 
1359
1430
 
1360
1431
 
1432
+
1433
+
1434
+
1435
+
1361
1436
 
1362
1437
 
1363
1438
 
@@ -1404,6 +1479,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
1404
1479
 
1405
1480
 
1406
1481
 
1482
+
1483
+
1484
+
1485
+
1407
1486
 
1408
1487
 
1409
1488
 
@@ -1616,6 +1695,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
1616
1695
 
1617
1696
 
1618
1697
 
1698
+
1699
+
1700
+
1701
+
1619
1702
 
1620
1703
 
1621
1704
 
@@ -1666,6 +1749,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
1666
1749
 
1667
1750
 
1668
1751
 
1752
+
1753
+
1754
+
1755
+
1669
1756
 
1670
1757
 
1671
1758
 
@@ -1744,6 +1831,10 @@ var _SinglyLinkedList = class _SinglyLinkedList extends LinearLinkedBase {
1744
1831
 
1745
1832
 
1746
1833
 
1834
+
1835
+
1836
+
1837
+
1747
1838
 
1748
1839
 
1749
1840
 
@@ -2060,6 +2151,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2060
2151
 
2061
2152
 
2062
2153
 
2154
+
2155
+
2156
+
2157
+
2063
2158
 
2064
2159
 
2065
2160
 
@@ -2125,6 +2220,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2125
2220
 
2126
2221
 
2127
2222
 
2223
+
2224
+
2225
+
2226
+
2128
2227
 
2129
2228
 
2130
2229
 
@@ -2189,6 +2288,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2189
2288
 
2190
2289
 
2191
2290
 
2291
+
2292
+
2293
+
2294
+
2192
2295
 
2193
2296
 
2194
2297
 
@@ -2244,6 +2347,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2244
2347
 
2245
2348
 
2246
2349
 
2350
+
2351
+
2352
+
2353
+
2247
2354
 
2248
2355
 
2249
2356
 
@@ -2328,6 +2435,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2328
2435
 
2329
2436
 
2330
2437
 
2438
+
2439
+
2440
+
2441
+
2331
2442
 
2332
2443
 
2333
2444
 
@@ -2373,6 +2484,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2373
2484
 
2374
2485
 
2375
2486
 
2487
+
2488
+
2489
+
2490
+
2376
2491
 
2377
2492
 
2378
2493
 
@@ -2449,6 +2564,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2449
2564
 
2450
2565
 
2451
2566
 
2567
+
2568
+
2569
+
2570
+
2452
2571
 
2453
2572
 
2454
2573
 
@@ -2553,6 +2672,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2553
2672
 
2554
2673
 
2555
2674
 
2675
+
2676
+
2677
+
2678
+
2556
2679
 
2557
2680
 
2558
2681
 
@@ -2604,6 +2727,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2604
2727
 
2605
2728
 
2606
2729
 
2730
+
2731
+
2732
+
2733
+
2607
2734
 
2608
2735
 
2609
2736
 
@@ -2657,6 +2784,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2657
2784
 
2658
2785
 
2659
2786
 
2787
+
2788
+
2789
+
2790
+
2660
2791
 
2661
2792
 
2662
2793
 
@@ -2697,6 +2828,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2697
2828
 
2698
2829
 
2699
2830
 
2831
+
2832
+
2833
+
2834
+
2700
2835
 
2701
2836
 
2702
2837
 
@@ -2741,6 +2876,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2741
2876
 
2742
2877
 
2743
2878
 
2879
+
2880
+
2881
+
2882
+
2744
2883
 
2745
2884
 
2746
2885
 
@@ -2789,6 +2928,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2789
2928
 
2790
2929
 
2791
2930
 
2931
+
2932
+
2933
+
2934
+
2792
2935
 
2793
2936
 
2794
2937
 
@@ -2840,6 +2983,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2840
2983
 
2841
2984
 
2842
2985
 
2986
+
2987
+
2988
+
2989
+
2843
2990
 
2844
2991
 
2845
2992
 
@@ -2899,6 +3046,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2899
3046
 
2900
3047
 
2901
3048
 
3049
+
3050
+
3051
+
3052
+
2902
3053
 
2903
3054
 
2904
3055
 
@@ -2948,6 +3099,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
2948
3099
 
2949
3100
 
2950
3101
 
3102
+
3103
+
3104
+
3105
+
2951
3106
 
2952
3107
 
2953
3108
 
@@ -3016,6 +3171,10 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
3016
3171
 
3017
3172
 
3018
3173
 
3174
+
3175
+
3176
+
3177
+
3019
3178
 
3020
3179
 
3021
3180
 
@@ -3126,31 +3285,6 @@ var _DoublyLinkedList = class _DoublyLinkedList extends LinearLinkedBase {
3126
3285
  __name(_DoublyLinkedList, "DoublyLinkedList");
3127
3286
  var DoublyLinkedList = _DoublyLinkedList;
3128
3287
 
3129
- // src/common/error.ts
3130
- var ERR = {
3131
- // Range / index
3132
- indexOutOfRange: /* @__PURE__ */ __name((index, min, max, ctx) => `${ctx ? ctx + ": " : ""}Index ${index} is out of range [${min}, ${max}].`, "indexOutOfRange"),
3133
- invalidIndex: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}Index must be an integer.`, "invalidIndex"),
3134
- // Type / argument
3135
- invalidArgument: /* @__PURE__ */ __name((reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`, "invalidArgument"),
3136
- comparatorRequired: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}Comparator is required for non-number/non-string/non-Date keys.`, "comparatorRequired"),
3137
- invalidKey: /* @__PURE__ */ __name((reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`, "invalidKey"),
3138
- notAFunction: /* @__PURE__ */ __name((name, ctx) => `${ctx ? ctx + ": " : ""}${name} must be a function.`, "notAFunction"),
3139
- invalidEntry: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}Each entry must be a [key, value] tuple.`, "invalidEntry"),
3140
- invalidNaN: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}NaN is not a valid key.`, "invalidNaN"),
3141
- invalidDate: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}Invalid Date key.`, "invalidDate"),
3142
- reduceEmpty: /* @__PURE__ */ __name((ctx) => `${ctx ? ctx + ": " : ""}Reduce of empty structure with no initial value.`, "reduceEmpty"),
3143
- callbackReturnType: /* @__PURE__ */ __name((expected, got, ctx) => `${ctx ? ctx + ": " : ""}Callback must return ${expected}; got ${got}.`, "callbackReturnType"),
3144
- // State / operation
3145
- invalidOperation: /* @__PURE__ */ __name((reason, ctx) => `${ctx ? ctx + ": " : ""}${reason}`, "invalidOperation"),
3146
- // Matrix
3147
- matrixDimensionMismatch: /* @__PURE__ */ __name((op) => `Matrix: Dimensions must be compatible for ${op}.`, "matrixDimensionMismatch"),
3148
- matrixSingular: /* @__PURE__ */ __name(() => "Matrix: Singular matrix, inverse does not exist.", "matrixSingular"),
3149
- matrixNotSquare: /* @__PURE__ */ __name(() => "Matrix: Must be square for inversion.", "matrixNotSquare"),
3150
- matrixNotRectangular: /* @__PURE__ */ __name(() => "Matrix: Must be rectangular for transposition.", "matrixNotRectangular"),
3151
- matrixRowMismatch: /* @__PURE__ */ __name((expected, got) => `Matrix: Expected row length ${expected}, but got ${got}.`, "matrixRowMismatch")
3152
- };
3153
-
3154
3288
  // src/data-structures/base/iterable-entry-base.ts
3155
3289
  var _IterableEntryBase = class _IterableEntryBase {
3156
3290
  /**
@@ -3370,7 +3504,7 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3370
3504
  [k, v] = toEntryFn(item);
3371
3505
  } else {
3372
3506
  if (!Array.isArray(item) || item.length < 2) {
3373
- throw new TypeError(ERR.invalidEntry("SkipList"));
3507
+ raise(TypeError, ERR.invalidEntry("SkipList"));
3374
3508
  }
3375
3509
  [k, v] = item;
3376
3510
  }
@@ -3383,7 +3517,7 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3383
3517
  static createDefaultComparator() {
3384
3518
  return (a, b) => {
3385
3519
  if (typeof a === "number" && typeof b === "number") {
3386
- if (Number.isNaN(a) || Number.isNaN(b)) throw new TypeError(ERR.invalidNaN("SkipList"));
3520
+ if (Number.isNaN(a) || Number.isNaN(b)) raise(TypeError, ERR.invalidNaN("SkipList"));
3387
3521
  return a - b;
3388
3522
  }
3389
3523
  if (typeof a === "string" && typeof b === "string") {
@@ -3391,13 +3525,13 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3391
3525
  }
3392
3526
  if (a instanceof Date && b instanceof Date) {
3393
3527
  const ta = a.getTime(), tb = b.getTime();
3394
- if (Number.isNaN(ta) || Number.isNaN(tb)) throw new TypeError(ERR.invalidDate("SkipList"));
3528
+ if (Number.isNaN(ta) || Number.isNaN(tb)) raise(TypeError, ERR.invalidDate("SkipList"));
3395
3529
  return ta - tb;
3396
3530
  }
3397
3531
  if (typeof a === "bigint" && typeof b === "bigint") {
3398
3532
  return a < b ? -1 : a > b ? 1 : 0;
3399
3533
  }
3400
- throw new TypeError(ERR.comparatorRequired("SkipList"));
3534
+ raise(TypeError, ERR.comparatorRequired("SkipList"));
3401
3535
  };
3402
3536
  }
3403
3537
  // ─── Size & lifecycle ────────────────────────────────────────
@@ -3438,6 +3572,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3438
3572
 
3439
3573
 
3440
3574
 
3575
+
3576
+
3577
+
3578
+
3441
3579
 
3442
3580
 
3443
3581
 
@@ -3476,6 +3614,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3476
3614
 
3477
3615
 
3478
3616
 
3617
+
3618
+
3619
+
3620
+
3479
3621
 
3480
3622
 
3481
3623
 
@@ -3517,6 +3659,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3517
3659
 
3518
3660
 
3519
3661
 
3662
+
3663
+
3664
+
3665
+
3520
3666
 
3521
3667
 
3522
3668
 
@@ -3566,6 +3712,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3566
3712
 
3567
3713
 
3568
3714
 
3715
+
3716
+
3717
+
3718
+
3569
3719
 
3570
3720
 
3571
3721
 
@@ -3640,6 +3790,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3640
3790
 
3641
3791
 
3642
3792
 
3793
+
3794
+
3795
+
3796
+
3643
3797
 
3644
3798
 
3645
3799
 
@@ -3699,6 +3853,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3699
3853
 
3700
3854
 
3701
3855
 
3856
+
3857
+
3858
+
3859
+
3702
3860
 
3703
3861
 
3704
3862
 
@@ -3741,6 +3899,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3741
3899
 
3742
3900
 
3743
3901
 
3902
+
3903
+
3904
+
3905
+
3744
3906
 
3745
3907
 
3746
3908
 
@@ -3803,6 +3965,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3803
3965
 
3804
3966
 
3805
3967
 
3968
+
3969
+
3970
+
3971
+
3806
3972
 
3807
3973
 
3808
3974
 
@@ -3845,6 +4011,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3845
4011
 
3846
4012
 
3847
4013
 
4014
+
4015
+
4016
+
4017
+
3848
4018
 
3849
4019
 
3850
4020
 
@@ -3889,6 +4059,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3889
4059
 
3890
4060
 
3891
4061
 
4062
+
4063
+
4064
+
4065
+
3892
4066
 
3893
4067
 
3894
4068
 
@@ -3931,6 +4105,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3931
4105
 
3932
4106
 
3933
4107
 
4108
+
4109
+
4110
+
4111
+
3934
4112
 
3935
4113
 
3936
4114
 
@@ -3976,6 +4154,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
3976
4154
 
3977
4155
 
3978
4156
 
4157
+
4158
+
4159
+
4160
+
3979
4161
 
3980
4162
 
3981
4163
 
@@ -4026,6 +4208,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
4026
4208
 
4027
4209
 
4028
4210
 
4211
+
4212
+
4213
+
4214
+
4029
4215
 
4030
4216
 
4031
4217
 
@@ -4074,6 +4260,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
4074
4260
 
4075
4261
 
4076
4262
 
4263
+
4264
+
4265
+
4266
+
4077
4267
 
4078
4268
 
4079
4269
 
@@ -4121,6 +4311,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
4121
4311
 
4122
4312
 
4123
4313
 
4314
+
4315
+
4316
+
4317
+
4124
4318
 
4125
4319
 
4126
4320
 
@@ -4174,6 +4368,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
4174
4368
 
4175
4369
 
4176
4370
 
4371
+
4372
+
4373
+
4374
+
4177
4375
 
4178
4376
 
4179
4377
 
@@ -4235,6 +4433,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
4235
4433
 
4236
4434
 
4237
4435
 
4436
+
4437
+
4438
+
4439
+
4238
4440
 
4239
4441
 
4240
4442
 
@@ -4280,6 +4482,10 @@ var _SkipList = class _SkipList extends IterableEntryBase {
4280
4482
 
4281
4483
 
4282
4484
 
4485
+
4486
+
4487
+
4488
+
4283
4489
 
4284
4490
 
4285
4491