min-heap-typed 1.46.2 → 1.46.5
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/dist/data-structures/hash/hash-map.d.ts +31 -116
- package/dist/data-structures/hash/hash-map.js +126 -254
- package/dist/data-structures/hash/index.d.ts +0 -4
- package/dist/data-structures/hash/index.js +0 -4
- package/dist/data-structures/queue/deque.d.ts +6 -74
- package/dist/data-structures/queue/deque.js +20 -142
- package/dist/types/data-structures/hash/hash-map.d.ts +5 -0
- package/dist/types/data-structures/hash/index.d.ts +0 -4
- package/dist/types/data-structures/hash/index.js +0 -4
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.js +3 -3
- package/package.json +2 -2
- package/src/data-structures/hash/hash-map.ts +153 -275
- package/src/data-structures/hash/index.ts +0 -4
- package/src/data-structures/queue/deque.ts +22 -161
- package/src/types/data-structures/hash/hash-map.ts +6 -0
- package/src/types/data-structures/hash/index.ts +0 -4
- package/src/utils/utils.ts +1 -1
- package/dist/data-structures/hash/coordinate-map.d.ts +0 -44
- package/dist/data-structures/hash/coordinate-map.js +0 -62
- package/dist/data-structures/hash/coordinate-set.d.ts +0 -36
- package/dist/data-structures/hash/coordinate-set.js +0 -52
- package/dist/data-structures/hash/tree-map.d.ts +0 -2
- package/dist/data-structures/hash/tree-map.js +0 -6
- package/dist/data-structures/hash/tree-set.d.ts +0 -2
- package/dist/data-structures/hash/tree-set.js +0 -6
- package/dist/types/data-structures/hash/coordinate-map.d.ts +0 -1
- package/dist/types/data-structures/hash/coordinate-map.js +0 -2
- package/dist/types/data-structures/hash/coordinate-set.d.ts +0 -1
- package/dist/types/data-structures/hash/coordinate-set.js +0 -2
- package/dist/types/data-structures/hash/tree-map.d.ts +0 -1
- package/dist/types/data-structures/hash/tree-map.js +0 -2
- package/dist/types/data-structures/hash/tree-set.d.ts +0 -1
- package/dist/types/data-structures/hash/tree-set.js +0 -2
- package/src/data-structures/hash/coordinate-map.ts +0 -63
- package/src/data-structures/hash/coordinate-set.ts +0 -52
- package/src/data-structures/hash/tree-map.ts +0 -2
- package/src/data-structures/hash/tree-set.ts +0 -2
- package/src/types/data-structures/hash/coordinate-map.ts +0 -1
- package/src/types/data-structures/hash/coordinate-set.ts +0 -1
- package/src/types/data-structures/hash/tree-map.ts +0 -1
- package/src/types/data-structures/hash/tree-set.ts +0 -1
|
@@ -15,8 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./hash-table"), exports);
|
|
18
|
-
__exportStar(require("./coordinate-map"), exports);
|
|
19
|
-
__exportStar(require("./coordinate-set"), exports);
|
|
20
|
-
__exportStar(require("./tree-map"), exports);
|
|
21
|
-
__exportStar(require("./tree-set"), exports);
|
|
22
18
|
__exportStar(require("./hash-map"), exports);
|
|
@@ -5,39 +5,13 @@
|
|
|
5
5
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
6
6
|
* @license MIT License
|
|
7
7
|
*/
|
|
8
|
-
import { IterableWithSizeOrLength
|
|
8
|
+
import { IterableWithSizeOrLength } from "../../types";
|
|
9
9
|
/**
|
|
10
10
|
* Deque can provide random access with O(1) time complexity
|
|
11
11
|
* Deque is usually more compact and efficient in memory usage because it does not require additional space to store pointers.
|
|
12
12
|
* Deque may experience performance jitter, but DoublyLinkedList will not
|
|
13
13
|
* Deque is implemented using a dynamic array. Inserting or deleting beyond both ends of the array may require moving elements or reallocating space.
|
|
14
14
|
*/
|
|
15
|
-
export declare class DequeIterator<E> {
|
|
16
|
-
iterateDirection: IterateDirection;
|
|
17
|
-
index: number;
|
|
18
|
-
readonly deque: Deque<E>;
|
|
19
|
-
/**
|
|
20
|
-
* The constructor initializes the index, iterate direction, and prev/next functions for a
|
|
21
|
-
* DequeIterator object.
|
|
22
|
-
* @param {number} index - The index parameter represents the current index position of the iterator
|
|
23
|
-
* within the deque. It is a number that indicates the position of the element that the iterator is
|
|
24
|
-
* currently pointing to.
|
|
25
|
-
* @param deque - The `deque` parameter is an instance of the `Deque` class. It represents a
|
|
26
|
-
* double-ended queue data structure, which allows elements to be added or removed from both ends.
|
|
27
|
-
* @param iterateDirection - The `iterateDirection` parameter is an optional parameter that specifies
|
|
28
|
-
* the direction in which the iterator should iterate over the elements of the `deque`. It has a
|
|
29
|
-
* default value of `IterateDirection.DEFAULT`.
|
|
30
|
-
* @returns The constructor is not returning anything. It is used to initialize the properties of the
|
|
31
|
-
* object being created.
|
|
32
|
-
*/
|
|
33
|
-
constructor(index: number, deque: Deque<E>, iterateDirection?: IterateDirection);
|
|
34
|
-
get current(): E;
|
|
35
|
-
set current(newElement: E);
|
|
36
|
-
isAccessible(): boolean;
|
|
37
|
-
prev(): DequeIterator<E>;
|
|
38
|
-
next(): DequeIterator<E>;
|
|
39
|
-
clone(): DequeIterator<E>;
|
|
40
|
-
}
|
|
41
15
|
export declare class Deque<E> {
|
|
42
16
|
protected _bucketFirst: number;
|
|
43
17
|
protected _firstInBucket: number;
|
|
@@ -120,28 +94,14 @@ export declare class Deque<E> {
|
|
|
120
94
|
*/
|
|
121
95
|
clear(): void;
|
|
122
96
|
/**
|
|
123
|
-
* The
|
|
124
|
-
* @returns A new instance of the DequeIterator class is being returned.
|
|
125
|
-
*/
|
|
126
|
-
begin(): DequeIterator<E>;
|
|
127
|
-
/**
|
|
128
|
-
* The `end()` function returns a new `DequeIterator` object with the size and reference to the
|
|
129
|
-
* current deque.
|
|
130
|
-
* @returns A new instance of the DequeIterator class is being returned.
|
|
97
|
+
* The below function is a generator that yields elements from a collection one by one.
|
|
131
98
|
*/
|
|
132
|
-
|
|
99
|
+
begin(): Generator<E>;
|
|
133
100
|
/**
|
|
134
|
-
* The reverseBegin
|
|
135
|
-
* the
|
|
136
|
-
* @returns A new instance of the DequeIterator class is being returned.
|
|
101
|
+
* The function `reverseBegin()` is a generator that yields elements in reverse order starting from
|
|
102
|
+
* the last element.
|
|
137
103
|
*/
|
|
138
|
-
reverseBegin():
|
|
139
|
-
/**
|
|
140
|
-
* The reverseEnd() function returns a new DequeIterator object that iterates over the elements of a
|
|
141
|
-
* Deque in reverse order.
|
|
142
|
-
* @returns A new instance of the DequeIterator class is being returned.
|
|
143
|
-
*/
|
|
144
|
-
reverseEnd(): DequeIterator<E>;
|
|
104
|
+
reverseBegin(): Generator<E>;
|
|
145
105
|
/**
|
|
146
106
|
* Time Complexity - Amortized O(1) (possible reallocation)
|
|
147
107
|
* Space Complexity - O(n) (due to potential resizing).
|
|
@@ -294,34 +254,6 @@ export declare class Deque<E> {
|
|
|
294
254
|
* @returns The size of the data structure after the element has been deleted.
|
|
295
255
|
*/
|
|
296
256
|
delete(element: E): number;
|
|
297
|
-
/**
|
|
298
|
-
* Time Complexity: O(n)
|
|
299
|
-
* Space Complexity: O(1)
|
|
300
|
-
*/
|
|
301
|
-
/**
|
|
302
|
-
* Time Complexity: O(n)
|
|
303
|
-
* Space Complexity: O(1)
|
|
304
|
-
*
|
|
305
|
-
* The function deletes an element from a deque using an iterator and returns the next iterator.
|
|
306
|
-
* @param iter - The parameter `iter` is of type `DequeIterator<E>`. It represents an iterator object
|
|
307
|
-
* that is used to iterate over elements in a deque (double-ended queue).
|
|
308
|
-
* @returns the updated iterator after deleting an element from the deque.
|
|
309
|
-
*/
|
|
310
|
-
deleteByIterator(iter: DequeIterator<E>): DequeIterator<E>;
|
|
311
|
-
/**
|
|
312
|
-
* Time Complexity: O(n)
|
|
313
|
-
* Space Complexity: O(1)
|
|
314
|
-
*/
|
|
315
|
-
/**
|
|
316
|
-
* Time Complexity: O(n)
|
|
317
|
-
* Space Complexity: O(1)
|
|
318
|
-
*
|
|
319
|
-
* The function `findIterator` searches for an element in a deque and returns an iterator pointing to
|
|
320
|
-
* the element if found, otherwise it returns an iterator pointing to the end of the deque.
|
|
321
|
-
* @param {E} element - The `element` parameter is the element that you want to find in the deque.
|
|
322
|
-
* @returns The method `findIterator(element: E)` returns a `DequeIterator<E>` object.
|
|
323
|
-
*/
|
|
324
|
-
findIterator(element: E): DequeIterator<E>;
|
|
325
257
|
/**
|
|
326
258
|
* Time Complexity: O(n)
|
|
327
259
|
* Space Complexity: O(1)
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @license MIT License
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ObjectDeque = exports.Deque =
|
|
10
|
+
exports.ObjectDeque = exports.Deque = void 0;
|
|
11
11
|
const utils_1 = require("../../utils");
|
|
12
12
|
/**
|
|
13
13
|
* Deque can provide random access with O(1) time complexity
|
|
@@ -15,78 +15,6 @@ const utils_1 = require("../../utils");
|
|
|
15
15
|
* Deque may experience performance jitter, but DoublyLinkedList will not
|
|
16
16
|
* Deque is implemented using a dynamic array. Inserting or deleting beyond both ends of the array may require moving elements or reallocating space.
|
|
17
17
|
*/
|
|
18
|
-
class DequeIterator {
|
|
19
|
-
/**
|
|
20
|
-
* The constructor initializes the index, iterate direction, and prev/next functions for a
|
|
21
|
-
* DequeIterator object.
|
|
22
|
-
* @param {number} index - The index parameter represents the current index position of the iterator
|
|
23
|
-
* within the deque. It is a number that indicates the position of the element that the iterator is
|
|
24
|
-
* currently pointing to.
|
|
25
|
-
* @param deque - The `deque` parameter is an instance of the `Deque` class. It represents a
|
|
26
|
-
* double-ended queue data structure, which allows elements to be added or removed from both ends.
|
|
27
|
-
* @param iterateDirection - The `iterateDirection` parameter is an optional parameter that specifies
|
|
28
|
-
* the direction in which the iterator should iterate over the elements of the `deque`. It has a
|
|
29
|
-
* default value of `IterateDirection.DEFAULT`.
|
|
30
|
-
* @returns The constructor is not returning anything. It is used to initialize the properties of the
|
|
31
|
-
* object being created.
|
|
32
|
-
*/
|
|
33
|
-
constructor(index, deque, iterateDirection = 0 /* IterateDirection.DEFAULT */) {
|
|
34
|
-
this.index = index;
|
|
35
|
-
this.iterateDirection = iterateDirection;
|
|
36
|
-
if (this.iterateDirection === 0 /* IterateDirection.DEFAULT */) {
|
|
37
|
-
this.prev = function () {
|
|
38
|
-
if (this.index === 0) {
|
|
39
|
-
(0, utils_1.throwRangeError)();
|
|
40
|
-
}
|
|
41
|
-
this.index -= 1;
|
|
42
|
-
return this;
|
|
43
|
-
};
|
|
44
|
-
this.next = function () {
|
|
45
|
-
if (this.index === this.deque.size) {
|
|
46
|
-
(0, utils_1.throwRangeError)();
|
|
47
|
-
}
|
|
48
|
-
this.index += 1;
|
|
49
|
-
return this;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
this.prev = function () {
|
|
54
|
-
if (this.index === this.deque.size - 1) {
|
|
55
|
-
(0, utils_1.throwRangeError)();
|
|
56
|
-
}
|
|
57
|
-
this.index += 1;
|
|
58
|
-
return this;
|
|
59
|
-
};
|
|
60
|
-
this.next = function () {
|
|
61
|
-
if (this.index === -1) {
|
|
62
|
-
(0, utils_1.throwRangeError)();
|
|
63
|
-
}
|
|
64
|
-
this.index -= 1;
|
|
65
|
-
return this;
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
this.deque = deque;
|
|
69
|
-
}
|
|
70
|
-
get current() {
|
|
71
|
-
return this.deque.getAt(this.index);
|
|
72
|
-
}
|
|
73
|
-
set current(newElement) {
|
|
74
|
-
this.deque.setAt(this.index, newElement);
|
|
75
|
-
}
|
|
76
|
-
isAccessible() {
|
|
77
|
-
return this.index !== this.deque.size;
|
|
78
|
-
}
|
|
79
|
-
prev() {
|
|
80
|
-
return this;
|
|
81
|
-
}
|
|
82
|
-
next() {
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
|
-
clone() {
|
|
86
|
-
return new DequeIterator(this.index, this.deque, this.iterateDirection);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
exports.DequeIterator = DequeIterator;
|
|
90
18
|
class Deque {
|
|
91
19
|
/**
|
|
92
20
|
* The constructor initializes a data structure with a specified bucket size and populates it with
|
|
@@ -220,35 +148,25 @@ class Deque {
|
|
|
220
148
|
this._firstInBucket = this._lastInBucket = this._bucketSize >> 1;
|
|
221
149
|
}
|
|
222
150
|
/**
|
|
223
|
-
* The
|
|
224
|
-
* @returns A new instance of the DequeIterator class is being returned.
|
|
225
|
-
*/
|
|
226
|
-
begin() {
|
|
227
|
-
return new DequeIterator(0, this);
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* The `end()` function returns a new `DequeIterator` object with the size and reference to the
|
|
231
|
-
* current deque.
|
|
232
|
-
* @returns A new instance of the DequeIterator class is being returned.
|
|
151
|
+
* The below function is a generator that yields elements from a collection one by one.
|
|
233
152
|
*/
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
* @returns A new instance of the DequeIterator class is being returned.
|
|
241
|
-
*/
|
|
242
|
-
reverseBegin() {
|
|
243
|
-
return new DequeIterator(this.size - 1, this, 1 /* IterateDirection.REVERSE */);
|
|
153
|
+
*begin() {
|
|
154
|
+
let index = 0;
|
|
155
|
+
while (index < this.size) {
|
|
156
|
+
yield this.getAt(index);
|
|
157
|
+
index++;
|
|
158
|
+
}
|
|
244
159
|
}
|
|
245
160
|
/**
|
|
246
|
-
* The
|
|
247
|
-
*
|
|
248
|
-
* @returns A new instance of the DequeIterator class is being returned.
|
|
161
|
+
* The function `reverseBegin()` is a generator that yields elements in reverse order starting from
|
|
162
|
+
* the last element.
|
|
249
163
|
*/
|
|
250
|
-
|
|
251
|
-
|
|
164
|
+
*reverseBegin() {
|
|
165
|
+
let index = this.size - 1;
|
|
166
|
+
while (index >= 0) {
|
|
167
|
+
yield this.getAt(index);
|
|
168
|
+
index--;
|
|
169
|
+
}
|
|
252
170
|
}
|
|
253
171
|
/**
|
|
254
172
|
* Time Complexity - Amortized O(1) (possible reallocation)
|
|
@@ -399,7 +317,7 @@ class Deque {
|
|
|
399
317
|
* @returns The element at the specified position in the data structure is being returned.
|
|
400
318
|
*/
|
|
401
319
|
getAt(pos) {
|
|
402
|
-
utils_1.rangeCheck(pos, 0, this.size - 1);
|
|
320
|
+
(0, utils_1.rangeCheck)(pos, 0, this.size - 1);
|
|
403
321
|
const { bucketIndex, indexInBucket } = this._getBucketAndPosition(pos);
|
|
404
322
|
return this._buckets[bucketIndex][indexInBucket];
|
|
405
323
|
}
|
|
@@ -418,7 +336,7 @@ class Deque {
|
|
|
418
336
|
* position in the data structure.
|
|
419
337
|
*/
|
|
420
338
|
setAt(pos, element) {
|
|
421
|
-
utils_1.rangeCheck(pos, 0, this.size - 1);
|
|
339
|
+
(0, utils_1.rangeCheck)(pos, 0, this.size - 1);
|
|
422
340
|
const { bucketIndex, indexInBucket } = this._getBucketAndPosition(pos);
|
|
423
341
|
this._buckets[bucketIndex][indexInBucket] = element;
|
|
424
342
|
}
|
|
@@ -443,7 +361,7 @@ class Deque {
|
|
|
443
361
|
*/
|
|
444
362
|
insertAt(pos, element, num = 1) {
|
|
445
363
|
const length = this.size;
|
|
446
|
-
utils_1.rangeCheck(pos, 0, length);
|
|
364
|
+
(0, utils_1.rangeCheck)(pos, 0, length);
|
|
447
365
|
if (pos === 0) {
|
|
448
366
|
while (num--)
|
|
449
367
|
this.unshift(element);
|
|
@@ -506,7 +424,7 @@ class Deque {
|
|
|
506
424
|
* @returns The size of the data structure after the deletion operation is performed.
|
|
507
425
|
*/
|
|
508
426
|
deleteAt(pos) {
|
|
509
|
-
utils_1.rangeCheck(pos, 0, this.size - 1);
|
|
427
|
+
(0, utils_1.rangeCheck)(pos, 0, this.size - 1);
|
|
510
428
|
if (pos === 0)
|
|
511
429
|
this.shift();
|
|
512
430
|
else if (pos === this.size - 1)
|
|
@@ -555,46 +473,6 @@ class Deque {
|
|
|
555
473
|
this.cut(index - 1);
|
|
556
474
|
return this.size;
|
|
557
475
|
}
|
|
558
|
-
/**
|
|
559
|
-
* Time Complexity: O(n)
|
|
560
|
-
* Space Complexity: O(1)
|
|
561
|
-
*/
|
|
562
|
-
/**
|
|
563
|
-
* Time Complexity: O(n)
|
|
564
|
-
* Space Complexity: O(1)
|
|
565
|
-
*
|
|
566
|
-
* The function deletes an element from a deque using an iterator and returns the next iterator.
|
|
567
|
-
* @param iter - The parameter `iter` is of type `DequeIterator<E>`. It represents an iterator object
|
|
568
|
-
* that is used to iterate over elements in a deque (double-ended queue).
|
|
569
|
-
* @returns the updated iterator after deleting an element from the deque.
|
|
570
|
-
*/
|
|
571
|
-
deleteByIterator(iter) {
|
|
572
|
-
const index = iter.index;
|
|
573
|
-
this.deleteAt(index);
|
|
574
|
-
iter = iter.next();
|
|
575
|
-
return iter;
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
* Time Complexity: O(n)
|
|
579
|
-
* Space Complexity: O(1)
|
|
580
|
-
*/
|
|
581
|
-
/**
|
|
582
|
-
* Time Complexity: O(n)
|
|
583
|
-
* Space Complexity: O(1)
|
|
584
|
-
*
|
|
585
|
-
* The function `findIterator` searches for an element in a deque and returns an iterator pointing to
|
|
586
|
-
* the element if found, otherwise it returns an iterator pointing to the end of the deque.
|
|
587
|
-
* @param {E} element - The `element` parameter is the element that you want to find in the deque.
|
|
588
|
-
* @returns The method `findIterator(element: E)` returns a `DequeIterator<E>` object.
|
|
589
|
-
*/
|
|
590
|
-
findIterator(element) {
|
|
591
|
-
for (let i = 0; i < this.size; ++i) {
|
|
592
|
-
if (this.getAt(i) === element) {
|
|
593
|
-
return new DequeIterator(i, this);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
return this.end();
|
|
597
|
-
}
|
|
598
476
|
/**
|
|
599
477
|
* Time Complexity: O(n)
|
|
600
478
|
* Space Complexity: O(1)
|
|
@@ -14,9 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./coordinate-map"), exports);
|
|
18
|
-
__exportStar(require("./coordinate-set"), exports);
|
|
19
17
|
__exportStar(require("./hash-map"), exports);
|
|
20
18
|
__exportStar(require("./hash-table"), exports);
|
|
21
|
-
__exportStar(require("./tree-map"), exports);
|
|
22
|
-
__exportStar(require("./tree-set"), exports);
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ export declare const trampolineAsync: (fn: TrlAsyncFn) => ((...args: [...Paramet
|
|
|
20
20
|
export declare const getMSB: (value: number) => number;
|
|
21
21
|
export declare const rangeCheck: (index: number, min: number, max: number, message?: string) => void;
|
|
22
22
|
export declare const throwRangeError: (message?: string) => void;
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const isWeakKey: (input: unknown) => input is object;
|
|
24
24
|
export declare const calcMinUnitsRequired: (totalQuantity: number, unitSize: number) => number;
|
package/dist/utils/utils.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.calcMinUnitsRequired = exports.
|
|
12
|
+
exports.calcMinUnitsRequired = exports.isWeakKey = exports.throwRangeError = exports.rangeCheck = exports.getMSB = exports.trampolineAsync = exports.trampoline = exports.toThunk = exports.isThunk = exports.THUNK_SYMBOL = exports.arrayRemove = exports.uuidV4 = void 0;
|
|
13
13
|
const uuidV4 = function () {
|
|
14
14
|
return 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, function (c) {
|
|
15
15
|
const r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
@@ -80,10 +80,10 @@ const throwRangeError = (message = 'The value is off-limits.') => {
|
|
|
80
80
|
throw new RangeError(message);
|
|
81
81
|
};
|
|
82
82
|
exports.throwRangeError = throwRangeError;
|
|
83
|
-
const
|
|
83
|
+
const isWeakKey = (input) => {
|
|
84
84
|
const inputType = typeof input;
|
|
85
85
|
return (inputType === 'object' && input !== null) || inputType === 'function';
|
|
86
86
|
};
|
|
87
|
-
exports.
|
|
87
|
+
exports.isWeakKey = isWeakKey;
|
|
88
88
|
const calcMinUnitsRequired = (totalQuantity, unitSize) => Math.floor((totalQuantity + unitSize - 1) / unitSize);
|
|
89
89
|
exports.calcMinUnitsRequired = calcMinUnitsRequired;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "min-heap-typed",
|
|
3
|
-
"version": "1.46.
|
|
3
|
+
"version": "1.46.5",
|
|
4
4
|
"description": "Min Heap. Javascript & Typescript Data Structure.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -132,6 +132,6 @@
|
|
|
132
132
|
"typescript": "^4.9.5"
|
|
133
133
|
},
|
|
134
134
|
"dependencies": {
|
|
135
|
-
"data-structure-typed": "^1.46.
|
|
135
|
+
"data-structure-typed": "^1.46.5"
|
|
136
136
|
}
|
|
137
137
|
}
|