data-structure-typed 1.49.7 → 1.49.8
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/CHANGELOG.md +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +4 -4
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/rb-tree.js +2 -2
- package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/cjs/types/data-structures/binary-tree/rb-tree.d.ts +1 -1
- package/dist/mjs/data-structures/binary-tree/binary-tree.js +4 -4
- package/dist/mjs/data-structures/binary-tree/rb-tree.js +1 -2
- package/dist/mjs/types/data-structures/binary-tree/rb-tree.d.ts +1 -1
- package/dist/umd/data-structure-typed.js +6 -6
- package/dist/umd/data-structure-typed.min.js +2 -2
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +1 -1
- package/src/data-structures/binary-tree/binary-tree.ts +4 -4
- package/src/data-structures/binary-tree/rb-tree.ts +1 -2
- package/src/types/data-structures/binary-tree/rb-tree.ts +1 -1
- package/test/integration/index.html +4 -4
- package/test/unit/data-structures/binary-tree/overall.test.ts +180 -1
- package/test/unit/data-structures/hash/hash-map.test.ts +19 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "data-structure-typed",
|
|
3
|
-
"version": "1.49.
|
|
3
|
+
"version": "1.49.8",
|
|
4
4
|
"description": "Data Structures of Javascript & TypeScript. Heap, Binary Tree, Red Black Tree, Linked List, Deque, Trie, HashMap, Directed Graph, Undirected Graph, Binary Search Tree(BST), AVL Tree, Priority Queue, Graph, Queue, Tree Multiset, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue, Stack. Benchmark compared with C++ STL. API aligned with ES6 and Java.util. Usability is comparable to Python",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/mjs/index.js",
|
|
@@ -1509,8 +1509,8 @@ export class BinaryTree<
|
|
|
1509
1509
|
if (current && this.isNodeOrNull(current.left)) queue.push(current.left);
|
|
1510
1510
|
if (current && this.isNodeOrNull(current.right)) queue.push(current.right);
|
|
1511
1511
|
} else {
|
|
1512
|
-
if (current.left) queue.push(current.left);
|
|
1513
|
-
if (current.right) queue.push(current.right);
|
|
1512
|
+
if (this.isRealNode(current.left)) queue.push(current.left);
|
|
1513
|
+
if (this.isRealNode(current.right)) queue.push(current.right);
|
|
1514
1514
|
}
|
|
1515
1515
|
|
|
1516
1516
|
traverse(level + 1);
|
|
@@ -1530,8 +1530,8 @@ export class BinaryTree<
|
|
|
1530
1530
|
if (current && this.isNodeOrNull(current.left)) queue.push(current.left);
|
|
1531
1531
|
if (current && this.isNodeOrNull(current.right)) queue.push(current.right);
|
|
1532
1532
|
} else {
|
|
1533
|
-
if (current.left) queue.push(current.left);
|
|
1534
|
-
if (current.right) queue.push(current.right);
|
|
1533
|
+
if (this.isRealNode(current.left)) queue.push(current.left);
|
|
1534
|
+
if (this.isRealNode(current.right)) queue.push(current.right);
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
@@ -106,7 +106,6 @@ export class RedBlackTree<
|
|
|
106
106
|
override createTree(options?: RBTreeOptions<K>): TREE {
|
|
107
107
|
return new RedBlackTree<K, V, N, TREE>([], {
|
|
108
108
|
iterationType: this.iterationType,
|
|
109
|
-
variant: this.variant,
|
|
110
109
|
...options
|
|
111
110
|
}) as TREE;
|
|
112
111
|
}
|
|
@@ -316,9 +315,9 @@ export class RedBlackTree<
|
|
|
316
315
|
this._fixDelete(x!);
|
|
317
316
|
}
|
|
318
317
|
this._size--;
|
|
318
|
+
ans.push({ deleted: z, needBalanced: undefined });
|
|
319
319
|
};
|
|
320
320
|
helper(this.root);
|
|
321
|
-
// TODO
|
|
322
321
|
return ans;
|
|
323
322
|
}
|
|
324
323
|
|
|
@@ -7,4 +7,4 @@ export type RedBlackTreeNodeNested<K, V> = RedBlackTreeNode<K, V, RedBlackTreeNo
|
|
|
7
7
|
|
|
8
8
|
export type RedBlackTreeNested<K, V, N extends RedBlackTreeNode<K, V, N>> = RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, RedBlackTree<K, V, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
9
9
|
|
|
10
|
-
export type RBTreeOptions<K> = BSTOptions<K> & {};
|
|
10
|
+
export type RBTreeOptions<K> = Omit<BSTOptions<K>, 'variant'> & {};
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset='UTF-8'>
|
|
5
5
|
<title>CDN Test</title>
|
|
6
6
|
<!-- <script src="../../dist/umd/data-structure-typed.min.js"></script>-->
|
|
7
|
-
|
|
8
|
-
<script src='https://cdn.jsdelivr.net/npm/data-structure-typed/dist/umd/data-structure-typed.min.js'></script
|
|
7
|
+
<script src="../../dist/umd/data-structure-typed.js"></script>
|
|
8
|
+
<!-- <script src='https://cdn.jsdelivr.net/npm/data-structure-typed/dist/umd/data-structure-typed.min.js'></script>-->
|
|
9
9
|
<!-- <script src='https://cdn.jsdelivr.net/npm/data-structure-typed@1.42.2/dist/umd/data-structure-typed.min.js'></script>-->
|
|
10
10
|
<!-- <script src='https://cdn.jsdelivr.net/npm/data-structure-typed@1.43.3/dist/umd/data-structure-typed.min.js'></script>-->
|
|
11
11
|
<!-- <script src='https://cdn.jsdelivr.net/npm/data-structure-typed@1.44.0/dist/umd/data-structure-typed.min.js'></script>-->
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
try {
|
|
115
115
|
const { PriorityQueue: CPriorityQueue } = sdsl;
|
|
116
116
|
const { PriorityQueue } = dataStructureTyped;
|
|
117
|
-
const pq = new PriorityQueue({ comparator: (a, b) => b - a });
|
|
117
|
+
const pq = new PriorityQueue([], { comparator: (a, b) => b - a });
|
|
118
118
|
|
|
119
119
|
const tS = performance.now();
|
|
120
120
|
const n = 1000000;
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
for (let i = 0; i < n; i++) {
|
|
126
|
-
pq.
|
|
126
|
+
pq.poll();
|
|
127
127
|
}
|
|
128
128
|
console.log((performance.now() - tS).toFixed(2), `PriorityQueue ${n.toLocaleString()} add`);
|
|
129
129
|
console.log(pq.size, `pq.size`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AVLTree, BST } from '../../../../src';
|
|
1
|
+
import { AVLTree, BST, BSTVariant, IterationType, RedBlackTree, TreeMultimap } from '../../../../src';
|
|
2
2
|
|
|
3
3
|
describe('Overall BinaryTree Test', () => {
|
|
4
4
|
it('should perform various operations on BinaryTree', () => {
|
|
@@ -60,4 +60,183 @@ describe('Overall BinaryTree Test', () => {
|
|
|
60
60
|
avlTree.isAVLBalanced(); // true
|
|
61
61
|
expect(avlTree.isAVLBalanced()).toBe(true); // true
|
|
62
62
|
});
|
|
63
|
+
|
|
64
|
+
it('Should clone a BST works fine', () => {
|
|
65
|
+
const bst = new BST<number>([3, 6, 7, 1, 9], {
|
|
66
|
+
iterationType: IterationType.RECURSIVE,
|
|
67
|
+
variant: BSTVariant.INVERSE,
|
|
68
|
+
extractor: key => key
|
|
69
|
+
});
|
|
70
|
+
expect(bst.size).toBe(5);
|
|
71
|
+
expect(bst.root?.key).toBe(6);
|
|
72
|
+
expect(bst.root?.left?.key).toBe(7);
|
|
73
|
+
expect(bst.root?.left?.left?.key).toBe(9);
|
|
74
|
+
expect(bst.root?.right?.key).toBe(1);
|
|
75
|
+
expect(bst.root?.right?.left?.key).toBe(3);
|
|
76
|
+
expect(bst.getNodeByKey(7)?.left?.key).toBe(9);
|
|
77
|
+
expect(bst.getHeight()).toBe(2);
|
|
78
|
+
expect(bst.has(9)).toBe(true);
|
|
79
|
+
expect(bst.has(7)).toBe(true);
|
|
80
|
+
expect(bst.delete(7)[0].deleted?.key).toBe(7);
|
|
81
|
+
expect(bst.has(7)).toBe(false);
|
|
82
|
+
expect(bst.size).toBe(4);
|
|
83
|
+
expect(bst.root?.key).toBe(6);
|
|
84
|
+
expect(bst.root?.left?.key).toBe(9);
|
|
85
|
+
expect(bst.root?.right?.key).toBe(1);
|
|
86
|
+
expect(bst.root?.right?.left?.key).toBe(3);
|
|
87
|
+
expect(bst.getNodeByKey(6)?.left?.key).toBe(9);
|
|
88
|
+
expect(bst.getHeight()).toBe(2);
|
|
89
|
+
expect(bst.has(9)).toBe(true);
|
|
90
|
+
expect(bst.has(7)).toBe(false);
|
|
91
|
+
expect(bst.bfs()).toEqual([6, 9, 1, 3]);
|
|
92
|
+
const clonedBST = bst.clone();
|
|
93
|
+
expect(clonedBST.size).toBe(4);
|
|
94
|
+
expect(clonedBST.root?.key).toBe(6);
|
|
95
|
+
expect(clonedBST.root?.left?.key).toBe(9);
|
|
96
|
+
expect(clonedBST.root?.right?.key).toBe(1);
|
|
97
|
+
expect(clonedBST.root?.right?.left?.key).toBe(3);
|
|
98
|
+
expect(clonedBST.getNodeByKey(6)?.left?.key).toBe(9);
|
|
99
|
+
expect(clonedBST.getHeight()).toBe(2);
|
|
100
|
+
expect(clonedBST.has(9)).toBe(true);
|
|
101
|
+
expect(clonedBST.has(7)).toBe(false);
|
|
102
|
+
expect(clonedBST.bfs()).toEqual([6, 9, 1, 3]);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('Should clone a AVLTree works fine', () => {
|
|
106
|
+
const avl = new AVLTree<number>([3, 6, 7, 1, 9], {
|
|
107
|
+
iterationType: IterationType.RECURSIVE,
|
|
108
|
+
variant: BSTVariant.INVERSE,
|
|
109
|
+
extractor: key => key
|
|
110
|
+
});
|
|
111
|
+
expect(avl.size).toBe(5);
|
|
112
|
+
avl.add(2);
|
|
113
|
+
avl.add(5);
|
|
114
|
+
avl.add(4);
|
|
115
|
+
expect(avl.root?.key).toBe(3);
|
|
116
|
+
expect(avl.root?.left?.key).toBe(7);
|
|
117
|
+
expect(avl.root?.left?.left?.key).toBe(9);
|
|
118
|
+
expect(avl.root?.right?.key).toBe(1);
|
|
119
|
+
expect(avl.root?.right?.left?.key).toBe(2);
|
|
120
|
+
expect(avl.getNodeByKey(7)?.left?.key).toBe(9);
|
|
121
|
+
expect(avl.getHeight()).toBe(3);
|
|
122
|
+
expect(avl.has(9)).toBe(true);
|
|
123
|
+
expect(avl.has(7)).toBe(true);
|
|
124
|
+
expect(avl.delete(7)[0].deleted?.key).toBe(7);
|
|
125
|
+
expect(avl.has(7)).toBe(false);
|
|
126
|
+
expect(avl.size).toBe(7);
|
|
127
|
+
expect(avl.root?.key).toBe(3);
|
|
128
|
+
expect(avl.root?.left?.key).toBe(5);
|
|
129
|
+
expect(avl.root?.right?.key).toBe(1);
|
|
130
|
+
expect(avl.root?.right?.left?.key).toBe(2);
|
|
131
|
+
expect(avl.getNodeByKey(6)?.left?.key).toBe(undefined);
|
|
132
|
+
expect(avl.getHeight()).toBe(3);
|
|
133
|
+
expect(avl.has(9)).toBe(true);
|
|
134
|
+
expect(avl.has(7)).toBe(false);
|
|
135
|
+
expect(avl.bfs()).toEqual([3, 5, 1, 9, 4, 2, 6]);
|
|
136
|
+
const clonedAVL = avl.clone();
|
|
137
|
+
expect(clonedAVL.size).toBe(7);
|
|
138
|
+
expect(clonedAVL.root?.key).toBe(3);
|
|
139
|
+
expect(clonedAVL.root?.left?.key).toBe(5);
|
|
140
|
+
expect(clonedAVL.root?.right?.key).toBe(1);
|
|
141
|
+
expect(clonedAVL.root?.right?.left?.key).toBe(2);
|
|
142
|
+
expect(clonedAVL.getNodeByKey(6)?.left?.key).toBe(undefined);
|
|
143
|
+
expect(clonedAVL.getHeight()).toBe(3);
|
|
144
|
+
expect(clonedAVL.has(9)).toBe(true);
|
|
145
|
+
expect(clonedAVL.has(7)).toBe(false);
|
|
146
|
+
expect(clonedAVL.bfs()).toEqual([3, 5, 1, 9, 4, 2, 6]);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('Should clone a TreeMultimap works fine', () => {
|
|
150
|
+
const tmm = new TreeMultimap<number>([3, 6, 7, 1, 9], {
|
|
151
|
+
iterationType: IterationType.RECURSIVE,
|
|
152
|
+
variant: BSTVariant.INVERSE,
|
|
153
|
+
extractor: key => key
|
|
154
|
+
});
|
|
155
|
+
expect(tmm.size).toBe(5);
|
|
156
|
+
tmm.add(2);
|
|
157
|
+
tmm.add(2);
|
|
158
|
+
tmm.add(2);
|
|
159
|
+
tmm.add(5);
|
|
160
|
+
tmm.add(4);
|
|
161
|
+
expect(tmm.count).toBe(10);
|
|
162
|
+
expect(tmm.root?.key).toBe(3);
|
|
163
|
+
expect(tmm.root?.left?.key).toBe(7);
|
|
164
|
+
expect(tmm.root?.left?.left?.key).toBe(9);
|
|
165
|
+
expect(tmm.root?.right?.key).toBe(1);
|
|
166
|
+
expect(tmm.root?.right?.left?.key).toBe(2);
|
|
167
|
+
expect(tmm.getNodeByKey(7)?.left?.key).toBe(9);
|
|
168
|
+
expect(tmm.getHeight()).toBe(3);
|
|
169
|
+
expect(tmm.has(9)).toBe(true);
|
|
170
|
+
expect(tmm.has(7)).toBe(true);
|
|
171
|
+
expect(tmm.delete(7)[0].deleted?.key).toBe(7);
|
|
172
|
+
expect(tmm.has(7)).toBe(false);
|
|
173
|
+
expect(tmm.size).toBe(7);
|
|
174
|
+
expect(tmm.count).toBe(9);
|
|
175
|
+
expect(tmm.root?.key).toBe(3);
|
|
176
|
+
expect(tmm.root?.left?.key).toBe(5);
|
|
177
|
+
expect(tmm.root?.right?.key).toBe(1);
|
|
178
|
+
expect(tmm.root?.right?.left?.key).toBe(2);
|
|
179
|
+
expect(tmm.getNodeByKey(6)?.left?.key).toBe(undefined);
|
|
180
|
+
expect(tmm.getHeight()).toBe(3);
|
|
181
|
+
expect(tmm.has(9)).toBe(true);
|
|
182
|
+
expect(tmm.has(7)).toBe(false);
|
|
183
|
+
expect(tmm.bfs()).toEqual([3, 5, 1, 9, 4, 2, 6]);
|
|
184
|
+
const clonedTMM = tmm.clone();
|
|
185
|
+
expect(clonedTMM.size).toBe(7);
|
|
186
|
+
expect(clonedTMM.count).toBe(9);
|
|
187
|
+
expect(clonedTMM.root?.key).toBe(3);
|
|
188
|
+
expect(clonedTMM.root?.left?.key).toBe(5);
|
|
189
|
+
expect(clonedTMM.root?.right?.key).toBe(1);
|
|
190
|
+
expect(clonedTMM.root?.right?.left?.key).toBe(2);
|
|
191
|
+
expect(clonedTMM.getNodeByKey(6)?.left?.key).toBe(undefined);
|
|
192
|
+
expect(clonedTMM.getHeight()).toBe(3);
|
|
193
|
+
expect(clonedTMM.has(9)).toBe(true);
|
|
194
|
+
expect(clonedTMM.has(7)).toBe(false);
|
|
195
|
+
expect(clonedTMM.bfs()).toEqual([3, 5, 1, 9, 4, 2, 6]);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
it('Should clone a RedBlackTree works fine', () => {
|
|
199
|
+
const rbTree = new RedBlackTree<number>([3, 6, 7, 1, 9], {
|
|
200
|
+
iterationType: IterationType.RECURSIVE,
|
|
201
|
+
extractor: key => key
|
|
202
|
+
});
|
|
203
|
+
expect(rbTree.size).toBe(5);
|
|
204
|
+
rbTree.add(2);
|
|
205
|
+
rbTree.add(2);
|
|
206
|
+
rbTree.add(2);
|
|
207
|
+
rbTree.add(5);
|
|
208
|
+
rbTree.add(4);
|
|
209
|
+
expect(rbTree.root?.key).toBe(3);
|
|
210
|
+
expect(rbTree.root?.left?.key).toBe(1);
|
|
211
|
+
expect(rbTree.root?.left?.left?.key).toBe(NaN);
|
|
212
|
+
expect(rbTree.root?.right?.key).toBe(7);
|
|
213
|
+
expect(rbTree.root?.right?.left?.key).toBe(5);
|
|
214
|
+
expect(rbTree.getNodeByKey(7)?.left?.key).toBe(5);
|
|
215
|
+
expect(rbTree.getHeight()).toBe(4);
|
|
216
|
+
expect(rbTree.has(9)).toBe(true);
|
|
217
|
+
expect(rbTree.has(7)).toBe(true);
|
|
218
|
+
expect(rbTree.delete(7)?.[0]?.deleted?.key).toBe(7);
|
|
219
|
+
expect(rbTree.has(7)).toBe(false);
|
|
220
|
+
expect(rbTree.size).toBe(7);
|
|
221
|
+
expect(rbTree.root?.key).toBe(3);
|
|
222
|
+
expect(rbTree.root?.left?.key).toBe(1);
|
|
223
|
+
expect(rbTree.root?.right?.key).toBe(5);
|
|
224
|
+
expect(rbTree.root?.right?.left?.key).toBe(4);
|
|
225
|
+
expect(rbTree.getNodeByKey(6)?.left?.key).toBe(NaN);
|
|
226
|
+
expect(rbTree.getHeight()).toBe(4);
|
|
227
|
+
expect(rbTree.has(9)).toBe(true);
|
|
228
|
+
expect(rbTree.has(7)).toBe(false);
|
|
229
|
+
expect(rbTree.bfs()).toEqual([3, 1, 5, 2, 4, 9, 6]);
|
|
230
|
+
const clonedRbTree = rbTree.clone();
|
|
231
|
+
expect(clonedRbTree.size).toBe(7);
|
|
232
|
+
expect(clonedRbTree.root?.key).toBe(3);
|
|
233
|
+
expect(clonedRbTree.root?.left?.key).toBe(1);
|
|
234
|
+
expect(clonedRbTree.root?.right?.key).toBe(5);
|
|
235
|
+
expect(clonedRbTree.root?.right?.left?.key).toBe(4);
|
|
236
|
+
expect(clonedRbTree.getNodeByKey(6)?.left?.key).toBe(NaN);
|
|
237
|
+
expect(clonedRbTree.getHeight()).toBe(4);
|
|
238
|
+
expect(clonedRbTree.has(9)).toBe(true);
|
|
239
|
+
expect(clonedRbTree.has(7)).toBe(false);
|
|
240
|
+
expect(clonedRbTree.bfs()).toEqual([3, 1, 5, 2, 4, 9, 6]);
|
|
241
|
+
});
|
|
63
242
|
});
|
|
@@ -108,12 +108,25 @@ describe('HashMap Test2', () => {
|
|
|
108
108
|
expect(hashMap.get(keyObj)).toBe('objectValue');
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
test('Inheritability test', () => {
|
|
112
|
+
class ExtendedHashMap<K, V> extends HashMap<K, V> {
|
|
113
|
+
constructor(
|
|
114
|
+
elements: Iterable<[K, V]> = [],
|
|
115
|
+
options?: {
|
|
116
|
+
hashFn?: (key: K) => string;
|
|
117
|
+
someOtherParam: string;
|
|
118
|
+
}
|
|
119
|
+
) {
|
|
120
|
+
const { someOtherParam, ...restOptions } = options || {};
|
|
121
|
+
// do something with someOtherParam
|
|
122
|
+
super(elements, restOptions);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const eHM = new ExtendedHashMap<string, number>([], { someOtherParam: 'someOtherParam' });
|
|
127
|
+
eHM.set('one', 1);
|
|
128
|
+
expect(eHM.get('one')).toBe(1);
|
|
129
|
+
});
|
|
117
130
|
|
|
118
131
|
it('should update the value for an existing key', () => {
|
|
119
132
|
hashMap.set('key1', 'value1');
|