data-structure-typed 1.21.1 → 1.21.3

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 (115) hide show
  1. package/README.md +82 -33
  2. package/dist/bundle.js +2 -0
  3. package/dist/bundle.js.LICENSE.txt +13 -0
  4. package/dist/data-structures/binary-tree/abstract-binary-tree.d.ts +3 -3
  5. package/dist/data-structures/binary-tree/abstract-binary-tree.js +1 -1
  6. package/dist/data-structures/binary-tree/avl-tree.d.ts +2 -2
  7. package/dist/data-structures/binary-tree/binary-tree.d.ts +2 -2
  8. package/dist/data-structures/binary-tree/bst.d.ts +3 -3
  9. package/dist/data-structures/binary-tree/bst.js +1 -1
  10. package/dist/data-structures/binary-tree/rb-tree.d.ts +2 -2
  11. package/dist/data-structures/binary-tree/rb-tree.js +1 -1
  12. package/dist/data-structures/binary-tree/segment-tree.d.ts +1 -1
  13. package/dist/data-structures/binary-tree/tree-multiset.d.ts +3 -3
  14. package/dist/data-structures/binary-tree/tree-multiset.js +1 -1
  15. package/dist/data-structures/graph/abstract-graph.d.ts +8 -8
  16. package/dist/data-structures/graph/abstract-graph.js +6 -6
  17. package/dist/data-structures/graph/directed-graph.d.ts +2 -2
  18. package/dist/data-structures/graph/map-graph.d.ts +1 -1
  19. package/dist/data-structures/graph/undirected-graph.d.ts +2 -2
  20. package/dist/data-structures/heap/heap.d.ts +1 -1
  21. package/dist/data-structures/heap/heap.js +1 -1
  22. package/dist/data-structures/heap/max-heap.d.ts +1 -1
  23. package/dist/data-structures/heap/min-heap.d.ts +1 -1
  24. package/dist/data-structures/index.d.ts +0 -2
  25. package/dist/data-structures/index.js +0 -2
  26. package/dist/data-structures/matrix/navigator.d.ts +1 -1
  27. package/dist/data-structures/priority-queue/max-priority-queue.d.ts +1 -1
  28. package/dist/data-structures/priority-queue/min-priority-queue.d.ts +1 -1
  29. package/dist/data-structures/priority-queue/priority-queue.d.ts +1 -1
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.js +2 -0
  32. package/dist/{data-structures/interfaces → interfaces}/abstract-binary-tree.d.ts +1 -1
  33. package/dist/{data-structures/interfaces → interfaces}/avl-tree.d.ts +1 -1
  34. package/dist/{data-structures/interfaces → interfaces}/binary-tree.d.ts +1 -1
  35. package/dist/{data-structures/interfaces → interfaces}/bst.d.ts +1 -1
  36. package/dist/{data-structures/interfaces → interfaces}/rb-tree.d.ts +1 -1
  37. package/dist/{data-structures/interfaces → interfaces}/tree-multiset.d.ts +1 -1
  38. package/dist/{data-structures/types → types/data-structures}/abstract-binary-tree.d.ts +1 -1
  39. package/dist/{data-structures/types → types/data-structures}/avl-tree.d.ts +1 -1
  40. package/dist/{data-structures/types → types/data-structures}/binary-tree.d.ts +1 -1
  41. package/dist/{data-structures/types → types/data-structures}/bst.d.ts +1 -1
  42. package/dist/{data-structures/types → types/data-structures}/index.d.ts +0 -1
  43. package/dist/{data-structures/types → types/data-structures}/index.js +0 -1
  44. package/dist/{data-structures/types → types/data-structures}/rb-tree.d.ts +1 -1
  45. package/dist/{data-structures/types → types/data-structures}/tree-multiset.d.ts +1 -1
  46. package/dist/types/index.d.ts +3 -0
  47. package/dist/types/index.js +19 -0
  48. package/dist/utils/index.d.ts +0 -2
  49. package/dist/utils/index.js +0 -2
  50. package/dist/utils/utils.d.ts +1 -1
  51. package/package.json +28 -27
  52. package/.dependency-cruiser.js +0 -449
  53. package/dist/utils/validate-type.d.ts +0 -45
  54. package/dist/utils/validate-type.js +0 -58
  55. package/jest.config.js +0 -5
  56. package/rename_clear_files.sh +0 -29
  57. package/tsconfig.json +0 -38
  58. /package/dist/{data-structures/interfaces → interfaces}/abstract-binary-tree.js +0 -0
  59. /package/dist/{data-structures/interfaces → interfaces}/abstract-graph.d.ts +0 -0
  60. /package/dist/{data-structures/interfaces → interfaces}/abstract-graph.js +0 -0
  61. /package/dist/{data-structures/interfaces → interfaces}/avl-tree.js +0 -0
  62. /package/dist/{data-structures/interfaces → interfaces}/binary-tree.js +0 -0
  63. /package/dist/{data-structures/interfaces → interfaces}/bst.js +0 -0
  64. /package/dist/{data-structures/interfaces → interfaces}/directed-graph.d.ts +0 -0
  65. /package/dist/{data-structures/interfaces → interfaces}/directed-graph.js +0 -0
  66. /package/dist/{data-structures/interfaces → interfaces}/doubly-linked-list.d.ts +0 -0
  67. /package/dist/{data-structures/interfaces → interfaces}/doubly-linked-list.js +0 -0
  68. /package/dist/{data-structures/interfaces → interfaces}/heap.d.ts +0 -0
  69. /package/dist/{data-structures/interfaces → interfaces}/heap.js +0 -0
  70. /package/dist/{data-structures/interfaces → interfaces}/index.d.ts +0 -0
  71. /package/dist/{data-structures/interfaces → interfaces}/index.js +0 -0
  72. /package/dist/{data-structures/interfaces → interfaces}/navigator.d.ts +0 -0
  73. /package/dist/{data-structures/interfaces → interfaces}/navigator.js +0 -0
  74. /package/dist/{data-structures/interfaces → interfaces}/priority-queue.d.ts +0 -0
  75. /package/dist/{data-structures/interfaces → interfaces}/priority-queue.js +0 -0
  76. /package/dist/{data-structures/interfaces → interfaces}/rb-tree.js +0 -0
  77. /package/dist/{data-structures/interfaces → interfaces}/segment-tree.d.ts +0 -0
  78. /package/dist/{data-structures/interfaces → interfaces}/segment-tree.js +0 -0
  79. /package/dist/{data-structures/interfaces → interfaces}/singly-linked-list.d.ts +0 -0
  80. /package/dist/{data-structures/interfaces → interfaces}/singly-linked-list.js +0 -0
  81. /package/dist/{data-structures/interfaces → interfaces}/tree-multiset.js +0 -0
  82. /package/dist/{data-structures/interfaces → interfaces}/undirected-graph.d.ts +0 -0
  83. /package/dist/{data-structures/interfaces → interfaces}/undirected-graph.js +0 -0
  84. /package/dist/{data-structures/types → types/data-structures}/abstract-binary-tree.js +0 -0
  85. /package/dist/{data-structures/types → types/data-structures}/abstract-graph.d.ts +0 -0
  86. /package/dist/{data-structures/types → types/data-structures}/abstract-graph.js +0 -0
  87. /package/dist/{data-structures/types → types/data-structures}/avl-tree.js +0 -0
  88. /package/dist/{data-structures/types → types/data-structures}/binary-tree.js +0 -0
  89. /package/dist/{data-structures/types → types/data-structures}/bst.js +0 -0
  90. /package/dist/{data-structures/types → types/data-structures}/directed-graph.d.ts +0 -0
  91. /package/dist/{data-structures/types → types/data-structures}/directed-graph.js +0 -0
  92. /package/dist/{data-structures/types → types/data-structures}/doubly-linked-list.d.ts +0 -0
  93. /package/dist/{data-structures/types → types/data-structures}/doubly-linked-list.js +0 -0
  94. /package/dist/{data-structures/types → types/data-structures}/heap.d.ts +0 -0
  95. /package/dist/{data-structures/types → types/data-structures}/heap.js +0 -0
  96. /package/dist/{data-structures/types → types/data-structures}/map-graph.d.ts +0 -0
  97. /package/dist/{data-structures/types → types/data-structures}/map-graph.js +0 -0
  98. /package/dist/{data-structures/types → types/data-structures}/navigator.d.ts +0 -0
  99. /package/dist/{data-structures/types → types/data-structures}/navigator.js +0 -0
  100. /package/dist/{data-structures/types → types/data-structures}/priority-queue.d.ts +0 -0
  101. /package/dist/{data-structures/types → types/data-structures}/priority-queue.js +0 -0
  102. /package/dist/{data-structures/types → types/data-structures}/rb-tree.js +0 -0
  103. /package/dist/{data-structures/types → types/data-structures}/segment-tree.d.ts +0 -0
  104. /package/dist/{data-structures/types → types/data-structures}/segment-tree.js +0 -0
  105. /package/dist/{data-structures/types → types/data-structures}/singly-linked-list.d.ts +0 -0
  106. /package/dist/{data-structures/types → types/data-structures}/singly-linked-list.js +0 -0
  107. /package/dist/{data-structures/types → types/data-structures}/tree-multiset.js +0 -0
  108. /package/dist/{data-structures/types → types}/helpers.d.ts +0 -0
  109. /package/dist/{data-structures/types → types}/helpers.js +0 -0
  110. /package/dist/{utils/types → types/utils}/index.d.ts +0 -0
  111. /package/dist/{utils/types → types/utils}/index.js +0 -0
  112. /package/dist/{utils/types → types/utils}/utils.d.ts +0 -0
  113. /package/dist/{utils/types → types/utils}/utils.js +0 -0
  114. /package/dist/{utils/types → types/utils}/validate-type.d.ts +0 -0
  115. /package/dist/{utils/types → types/utils}/validate-type.js +0 -0
@@ -357,7 +357,7 @@ class AbstractGraph {
357
357
  /**
358
358
  * Dijkstra algorithm time: O(VE) space: O(V + E)
359
359
  * /
360
-
360
+
361
361
  /**
362
362
  * Dijkstra algorithm time: O(VE) space: O(V + E)
363
363
  * The function `dijkstraWithoutHeap` implements Dijkstra's algorithm to find the shortest path between two vertices in
@@ -484,7 +484,7 @@ class AbstractGraph {
484
484
  * The time complexity of Dijkstra's algorithm and the Bellman-Ford algorithm depends on the size of the graph, while the time complexity of the Floyd-Warshall algorithm is O(V^3), where V is the number of nodes. For dense graphs, Floyd-Warshall might become slower.
485
485
  *
486
486
  * /
487
-
487
+
488
488
  /**
489
489
  * Dijkstra's algorithm is used to find the shortest paths from a source node to all other nodes in a graph. Its basic idea is to repeatedly choose the node closest to the source node and update the distances of other nodes using this node as an intermediary. Dijkstra's algorithm requires that the edge weights in the graph are non-negative.
490
490
  * The `dijkstra` function implements Dijkstra's algorithm to find the shortest path between a source vertex and an
@@ -608,7 +608,7 @@ class AbstractGraph {
608
608
  * BellmanFord time:O(VE) space:O(V)
609
609
  * one to rest pairs
610
610
  * /
611
-
611
+
612
612
  /**
613
613
  * BellmanFord time:O(VE) space:O(V)
614
614
  * one to rest pairs
@@ -713,7 +713,7 @@ class AbstractGraph {
713
713
  /**
714
714
  * Dijkstra algorithm time: O(logVE) space: O(V + E)
715
715
  * /
716
-
716
+
717
717
  /**
718
718
  * Dijkstra algorithm time: O(logVE) space: O(V + E)
719
719
  * Dijkstra's algorithm is used to find the shortest paths from a source node to all other nodes in a graph. Its basic idea is to repeatedly choose the node closest to the source node and update the distances of other nodes using this node as an intermediary. Dijkstra's algorithm requires that the edge weights in the graph are non-negative.
@@ -733,7 +733,7 @@ class AbstractGraph {
733
733
  * Floyd algorithm time: O(V^3) space: O(V^2), not support graph with negative weight cycle
734
734
  * all pairs
735
735
  * /
736
-
736
+
737
737
  /**
738
738
  * Floyd algorithm time: O(V^3) space: O(V^2), not support graph with negative weight cycle
739
739
  * all pairs
@@ -783,7 +783,7 @@ class AbstractGraph {
783
783
  * Tarjan solve the bi-connected components of undirected graphs;
784
784
  * Tarjan can find the SSC(strongly connected components), articulation points, and bridges of directed graphs.
785
785
  * /
786
-
786
+
787
787
  /**
788
788
  * Tarjan is an algorithm based on DFS,which is used to solve the connectivity problem of graphs.
789
789
  * Tarjan can find cycles in directed or undirected graph
@@ -1,6 +1,6 @@
1
1
  import { AbstractEdge, AbstractGraph, AbstractVertex } from './abstract-graph';
2
- import type { VertexId } from '../types';
3
- import { IDirectedGraph } from '../interfaces';
2
+ import type { VertexId } from '../../types';
3
+ import { IDirectedGraph } from '../../interfaces';
4
4
  export declare class DirectedVertex<T = number> extends AbstractVertex<T> {
5
5
  /**
6
6
  * The constructor function initializes a vertex with an optional value.
@@ -1,4 +1,4 @@
1
- import { MapGraphCoordinate, VertexId } from '../types';
1
+ import { MapGraphCoordinate, VertexId } from '../../types';
2
2
  import { DirectedEdge, DirectedGraph, DirectedVertex } from './directed-graph';
3
3
  export declare class MapVertex<T = any> extends DirectedVertex<T> {
4
4
  /**
@@ -1,6 +1,6 @@
1
1
  import { AbstractEdge, AbstractGraph, AbstractVertex } from './abstract-graph';
2
- import type { VertexId } from '../types';
3
- import { IUNDirectedGraph } from '../interfaces';
2
+ import type { VertexId } from '../../types';
3
+ import { IUNDirectedGraph } from '../../interfaces';
4
4
  export declare class UndirectedVertex<T = number> extends AbstractVertex<T> {
5
5
  /**
6
6
  * The constructor function initializes a vertex with an optional value.
@@ -6,7 +6,7 @@
6
6
  * @license MIT License
7
7
  */
8
8
  import { PriorityQueue } from '../priority-queue';
9
- import type { HeapOptions } from '../types';
9
+ import type { HeapOptions } from '../../types';
10
10
  export declare class HeapItem<T = number> {
11
11
  /**
12
12
  * The constructor function initializes an instance of a class with a priority and a value.
@@ -9,7 +9,7 @@ class HeapItem {
9
9
  * @param {T | null} [val=null] - The `val` parameter is of type `T | null`, which means it can accept a value of type
10
10
  * `T` or `null`.
11
11
  */
12
- constructor(priority = NaN, val = null) {
12
+ constructor(priority = Number.MAX_SAFE_INTEGER, val = null) {
13
13
  this._val = val;
14
14
  this._priority = priority;
15
15
  }
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { Heap, HeapItem } from './heap';
9
9
  import { PriorityQueue } from '../priority-queue';
10
- import type { HeapOptions } from '../types';
10
+ import type { HeapOptions } from '../../types';
11
11
  /**
12
12
  * @class MaxHeap
13
13
  * @extends Heap
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { Heap, HeapItem } from './heap';
9
9
  import { PriorityQueue } from '../priority-queue';
10
- import type { HeapOptions } from '../types';
10
+ import type { HeapOptions } from '../../types';
11
11
  /**
12
12
  * @class MinHeap
13
13
  * @extends Heap
@@ -9,5 +9,3 @@ export * from './heap';
9
9
  export * from './priority-queue';
10
10
  export * from './matrix';
11
11
  export * from './trie';
12
- export * from './interfaces';
13
- export * from './types';
@@ -25,5 +25,3 @@ __exportStar(require("./heap"), exports);
25
25
  __exportStar(require("./priority-queue"), exports);
26
26
  __exportStar(require("./matrix"), exports);
27
27
  __exportStar(require("./trie"), exports);
28
- __exportStar(require("./interfaces"), exports);
29
- __exportStar(require("./types"), exports);
@@ -5,7 +5,7 @@
5
5
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
6
  * @license MIT License
7
7
  */
8
- import type { Direction, NavigatorParams, Turning } from '../types';
8
+ import type { Direction, NavigatorParams, Turning } from '../../types';
9
9
  export declare class Character {
10
10
  direction: Direction;
11
11
  turn: () => Character;
@@ -6,7 +6,7 @@
6
6
  * @license MIT License
7
7
  */
8
8
  import { PriorityQueue } from './priority-queue';
9
- import type { PriorityQueueOptions } from '../types';
9
+ import type { PriorityQueueOptions } from '../../types';
10
10
  export declare class MaxPriorityQueue<T = number> extends PriorityQueue<T> {
11
11
  constructor(options?: Omit<PriorityQueueOptions<number>, 'comparator'>);
12
12
  constructor(options: PriorityQueueOptions<T>);
@@ -6,7 +6,7 @@
6
6
  * @license MIT License
7
7
  */
8
8
  import { PriorityQueue } from './priority-queue';
9
- import type { PriorityQueueOptions } from '../types';
9
+ import type { PriorityQueueOptions } from '../../types';
10
10
  export declare class MinPriorityQueue<T = number> extends PriorityQueue<T> {
11
11
  constructor(options?: Omit<PriorityQueueOptions<number>, 'comparator'>);
12
12
  constructor(options: PriorityQueueOptions<T>);
@@ -5,7 +5,7 @@
5
5
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
6
  * @license MIT License
7
7
  */
8
- import type { PriorityQueueComparator, PriorityQueueDFSOrderPattern, PriorityQueueOptions } from '../types';
8
+ import type { PriorityQueueComparator, PriorityQueueDFSOrderPattern, PriorityQueueOptions } from '../../types';
9
9
  export declare class PriorityQueue<T = number> {
10
10
  /**
11
11
  * The constructor initializes a priority queue with the given options, including an array of nodes and a comparator
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './data-structures';
2
2
  export * from './utils';
3
+ export * from './interfaces';
4
+ export * from './types';
package/dist/index.js CHANGED
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./data-structures"), exports);
18
18
  __exportStar(require("./utils"), exports);
19
+ __exportStar(require("./interfaces"), exports);
20
+ __exportStar(require("./types"), exports);
@@ -1,5 +1,5 @@
1
1
  import { AbstractBinaryTreeNodeProperties, AbstractBinaryTreeNodeProperty, BinaryTreeDeletedResult, BinaryTreeNodeId, BinaryTreeNodePropertyName, DFSOrderPattern, FamilyPosition, LoopType, NodeOrPropertyName } from '../types';
2
- import { AbstractBinaryTreeNode } from '../binary-tree';
2
+ import { AbstractBinaryTreeNode } from '../data-structures';
3
3
  export interface IAbstractBinaryTreeNode<T, NEIGHBOR extends IAbstractBinaryTreeNode<T, NEIGHBOR>> {
4
4
  get id(): BinaryTreeNodeId;
5
5
  set id(v: BinaryTreeNodeId);
@@ -1,4 +1,4 @@
1
- import { AVLTreeNode } from '../binary-tree';
1
+ import { AVLTreeNode } from '../data-structures';
2
2
  import { IBST, IBSTNode } from './bst';
3
3
  import { BinaryTreeDeletedResult, BinaryTreeNodeId } from '../types';
4
4
  export interface IAVLTreeNode<T, NEIGHBOR extends IAVLTreeNode<T, NEIGHBOR>> extends IBSTNode<T, NEIGHBOR> {
@@ -1,4 +1,4 @@
1
- import { BinaryTreeNode } from '../binary-tree';
1
+ import { BinaryTreeNode } from '../data-structures';
2
2
  import { IAbstractBinaryTree, IAbstractBinaryTreeNode } from './abstract-binary-tree';
3
3
  export interface IBinaryTreeNode<T, NEIGHBOR extends IBinaryTreeNode<T, NEIGHBOR>> extends IAbstractBinaryTreeNode<T, NEIGHBOR> {
4
4
  }
@@ -1,4 +1,4 @@
1
- import { BSTNode } from '../binary-tree';
1
+ import { BSTNode } from '../data-structures';
2
2
  import { IBinaryTree, IBinaryTreeNode } from './binary-tree';
3
3
  import { BinaryTreeDeletedResult, BinaryTreeNodeId, BinaryTreeNodePropertyName } from '../types';
4
4
  export interface IBSTNode<T, NEIGHBOR extends IBSTNode<T, NEIGHBOR>> extends IBinaryTreeNode<T, NEIGHBOR> {
@@ -1,4 +1,4 @@
1
- import { RBTreeNode } from '../binary-tree';
1
+ import { RBTreeNode } from '../data-structures';
2
2
  import { IBST, IBSTNode } from './bst';
3
3
  import { BinaryTreeNodeId } from '../types';
4
4
  export interface IRBTreeNode<T, NEIGHBOR extends IRBTreeNode<T, NEIGHBOR>> extends IBSTNode<T, NEIGHBOR> {
@@ -1,4 +1,4 @@
1
- import { TreeMultisetNode } from '../binary-tree';
1
+ import { TreeMultisetNode } from '../data-structures';
2
2
  import { IBSTNode } from './bst';
3
3
  import { IAVLTree } from './avl-tree';
4
4
  export interface ITreeMultisetNode<T, NEIGHBOR extends ITreeMultisetNode<T, NEIGHBOR>> extends IBSTNode<T, NEIGHBOR> {
@@ -1,4 +1,4 @@
1
- import { AbstractBinaryTreeNode } from '../binary-tree';
1
+ import { AbstractBinaryTreeNode } from '../../data-structures/binary-tree';
2
2
  /**
3
3
  * Enum representing different loop types.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { AVLTreeNode } from '../binary-tree';
1
+ import { AVLTreeNode } from '../../data-structures/binary-tree';
2
2
  import { BSTOptions } from './bst';
3
3
  export type AVLTreeNodeNested<T> = AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, AVLTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
4
4
  export type AVLTreeOptions = BSTOptions & {};
@@ -1,4 +1,4 @@
1
- import { BinaryTreeNode } from '../binary-tree';
1
+ import { BinaryTreeNode } from '../../data-structures/binary-tree';
2
2
  import { AbstractBinaryTreeOptions } from './abstract-binary-tree';
3
3
  export type BinaryTreeNodeNested<T> = BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
4
4
  export type BinaryTreeOptions = AbstractBinaryTreeOptions & {};
@@ -1,4 +1,4 @@
1
- import { BSTNode } from '../binary-tree';
1
+ import { BSTNode } from '../../data-structures/binary-tree';
2
2
  import type { BinaryTreeOptions } from './binary-tree';
3
3
  import { BinaryTreeNodeId } from './abstract-binary-tree';
4
4
  export type BSTComparator = (a: BinaryTreeNodeId, b: BinaryTreeNodeId) => number;
@@ -13,4 +13,3 @@ export * from './heap';
13
13
  export * from './singly-linked-list';
14
14
  export * from './doubly-linked-list';
15
15
  export * from './navigator';
16
- export * from './helpers';
@@ -29,4 +29,3 @@ __exportStar(require("./heap"), exports);
29
29
  __exportStar(require("./singly-linked-list"), exports);
30
30
  __exportStar(require("./doubly-linked-list"), exports);
31
31
  __exportStar(require("./navigator"), exports);
32
- __exportStar(require("./helpers"), exports);
@@ -1,5 +1,5 @@
1
1
  import { BinaryTreeOptions } from './binary-tree';
2
- import { RBTreeNode } from '../binary-tree';
2
+ import { RBTreeNode } from '../../data-structures/binary-tree';
3
3
  export declare enum RBColor {
4
4
  RED = "RED",
5
5
  BLACK = "BLACK"
@@ -1,4 +1,4 @@
1
- import { TreeMultisetNode } from '../binary-tree';
1
+ import { TreeMultisetNode } from '../../data-structures/binary-tree';
2
2
  import { AVLTreeOptions } from './avl-tree';
3
3
  export type TreeMultisetNodeNested<T> = TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, TreeMultisetNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
4
4
  export type TreeMultisetOptions = Omit<AVLTreeOptions, 'isMergeDuplicatedNodeById'> & {};
@@ -0,0 +1,3 @@
1
+ export * from './data-structures';
2
+ export * from './helpers';
3
+ export * from './utils';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./data-structures"), exports);
18
+ __exportStar(require("./helpers"), exports);
19
+ __exportStar(require("./utils"), exports);
@@ -1,3 +1 @@
1
1
  export * from './utils';
2
- export * from './types';
3
- export * from './validate-type';
@@ -15,5 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./utils"), exports);
18
- __exportStar(require("./types"), exports);
19
- __exportStar(require("./validate-type"), exports);
@@ -5,7 +5,7 @@
5
5
  * @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
6
6
  * @license MIT License
7
7
  */
8
- import type { Thunk, ToThunkFn, TrlAsyncFn, TrlFn } from './types';
8
+ import type { Thunk, ToThunkFn, TrlAsyncFn, TrlFn } from '../types';
9
9
  export declare const uuidV4: () => string;
10
10
  export declare const arrayRemove: <T>(array: T[], predicate: (item: T, index: number, array: T[]) => boolean) => T[];
11
11
  export declare const THUNK_SYMBOL: unique symbol;
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "data-structure-typed",
3
- "version": "1.21.1",
3
+ "version": "1.21.3",
4
4
  "description": "Javascript & TypeScript Data Structure Library, meticulously crafted to empower developers with a versatile set of essential data structures. Our library includes a wide range of data structures, such as Binary Tree, AVL Tree, Binary Search Tree (BST), Tree Multiset, Segment Tree, Binary Indexed Tree, Graph, Directed Graph, Undirected Graph, Singly Linked List, Hash, CoordinateSet, CoordinateMap, Heap, Doubly Linked List, Priority Queue, Max Priority Queue, Min Priority Queue, Queue, ObjectDeque, ArrayDeque, Stack, and Trie. Each data structure is thoughtfully designed and implemented using TypeScript to provide efficient, reliable, and easy-to-use solutions for your programming needs. Whether you're optimizing algorithms, managing data, or enhancing performance, our TypeScript Data Structure Library is your go-to resource. Elevate your coding experience with these fundamental building blocks for software development.",
5
5
  "main": "dist/index.js",
6
- "module": "dist/my-library.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
7
8
  "scripts": {
8
- "build": "rm -rf dist && npx tsc",
9
+ "build": "rm -rf dist && npx tsc && npm run build:browser",
10
+ "build:browser": "webpack",
11
+ "build:docs": "typedoc --out docs ./src",
9
12
  "test": "jest",
10
13
  "update:test-deps": "npm i avl-tree-typed binary-tree-typed bst-typed deque-typed directed-graph-typed doubly-linked-list-typed graph-typed heap-typed linked-list-typed max-heap-typed max-priority-queue-typed min-heap-typed min-priority-queue-typed priority-queue-typed singly-linked-list-typed stack-typed tree-multiset-typed trie-typed undirected-graph-typed --save-dev",
11
- "build:docs": "typedoc --out docs ./src",
12
14
  "deps:check": "dependency-cruiser src",
13
15
  "build:publish": "npm run test && npm run build && npm run build:docs && npm publish"
14
16
  },
@@ -56,36 +58,35 @@
56
58
  "url": "https://github.com/zrwusa/data-structure-typed/issues"
57
59
  },
58
60
  "homepage": "https://github.com/zrwusa/data-structure-typed#readme",
59
- "types": "dist/index.d.ts",
60
61
  "devDependencies": {
61
62
  "@types/jest": "^29.5.3",
62
63
  "@types/node": "^20.4.9",
63
- "avl-tree-typed": "^1.21.0",
64
- "binary-tree-typed": "^1.21.0",
65
- "bst-typed": "^1.21.0",
64
+ "avl-tree-typed": "^1.21.2",
65
+ "binary-tree-typed": "^1.21.2",
66
+ "bst-typed": "^1.21.2",
66
67
  "dependency-cruiser": "^13.1.2",
67
- "deque-typed": "^1.21.0",
68
- "directed-graph-typed": "^1.21.0",
69
- "doubly-linked-list-typed": "^1.21.0",
70
- "graph-typed": "^1.21.0",
71
- "heap-typed": "^1.21.0",
68
+ "deque-typed": "^1.21.2",
69
+ "directed-graph-typed": "^1.21.2",
70
+ "doubly-linked-list-typed": "^1.21.2",
71
+ "graph-typed": "^1.21.2",
72
+ "heap-typed": "^1.21.2",
72
73
  "jest": "^29.6.2",
73
- "linked-list-typed": "^1.21.0",
74
- "max-heap-typed": "^1.21.0",
75
- "max-priority-queue-typed": "^1.21.0",
76
- "min-heap-typed": "^1.21.0",
77
- "min-priority-queue-typed": "^1.21.0",
78
- "priority-queue-typed": "^1.21.0",
79
- "singly-linked-list-typed": "^1.21.0",
80
- "stack-typed": "^1.21.0",
81
- "tree-multiset-typed": "^1.21.0",
82
- "trie-typed": "^1.21.0",
74
+ "linked-list-typed": "^1.21.2",
75
+ "max-heap-typed": "^1.21.2",
76
+ "max-priority-queue-typed": "^1.21.2",
77
+ "min-heap-typed": "^1.21.2",
78
+ "min-priority-queue-typed": "^1.21.2",
79
+ "priority-queue-typed": "^1.21.2",
80
+ "singly-linked-list-typed": "^1.21.2",
81
+ "stack-typed": "^1.21.2",
82
+ "tree-multiset-typed": "^1.21.2",
83
+ "trie-typed": "^1.21.2",
83
84
  "ts-jest": "^29.1.1",
85
+ "ts-loader": "^9.4.4",
84
86
  "typedoc": "^0.24.8",
85
87
  "typescript": "^4.9.5",
86
- "undirected-graph-typed": "^1.21.0"
87
- },
88
- "dependencies": {
89
- "zod": "^3.22.2"
88
+ "undirected-graph-typed": "^1.21.2",
89
+ "webpack": "^5.88.2",
90
+ "webpack-cli": "^5.1.4"
90
91
  }
91
92
  }