max-priority-queue-typed 2.5.0 → 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.
- package/dist/cjs/index.cjs +398 -55
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs-legacy/index.cjs +397 -54
- package/dist/cjs-legacy/index.cjs.map +1 -1
- package/dist/esm/index.mjs +398 -56
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm-legacy/index.mjs +397 -55
- package/dist/esm-legacy/index.mjs.map +1 -1
- package/dist/types/common/error.d.ts +9 -0
- package/dist/types/common/index.d.ts +1 -1
- package/dist/types/data-structures/base/index.d.ts +1 -0
- package/dist/types/data-structures/base/iterable-entry-base.d.ts +8 -8
- package/dist/types/data-structures/base/linear-base.d.ts +3 -3
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +288 -0
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +336 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +618 -18
- package/dist/types/data-structures/binary-tree/bst.d.ts +676 -1
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +456 -0
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +144 -1
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +3307 -399
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +3285 -360
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +2674 -325
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +3072 -287
- package/dist/types/data-structures/graph/abstract-graph.d.ts +4 -4
- package/dist/types/data-structures/graph/directed-graph.d.ts +240 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +216 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +274 -10
- package/dist/types/data-structures/heap/heap.d.ts +336 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +411 -3
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +363 -3
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +434 -2
- package/dist/types/data-structures/matrix/matrix.d.ts +192 -0
- package/dist/types/data-structures/queue/deque.d.ts +364 -4
- package/dist/types/data-structures/queue/queue.d.ts +288 -0
- package/dist/types/data-structures/stack/stack.d.ts +240 -0
- package/dist/types/data-structures/trie/trie.d.ts +292 -4
- package/dist/types/interfaces/graph.d.ts +1 -1
- package/dist/types/types/common.d.ts +2 -2
- package/dist/types/types/data-structures/binary-tree/bst.d.ts +1 -0
- package/dist/types/types/data-structures/binary-tree/tree-map.d.ts +5 -0
- package/dist/types/types/data-structures/binary-tree/tree-multi-set.d.ts +4 -0
- package/dist/types/types/data-structures/binary-tree/tree-set.d.ts +4 -0
- package/dist/types/types/data-structures/heap/heap.d.ts +1 -0
- package/dist/types/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
- package/dist/types/types/utils/validate-type.d.ts +4 -4
- package/dist/umd/max-priority-queue-typed.js +395 -53
- package/dist/umd/max-priority-queue-typed.js.map +1 -1
- package/dist/umd/max-priority-queue-typed.min.js +1 -1
- package/dist/umd/max-priority-queue-typed.min.js.map +1 -1
- package/package.json +2 -2
- package/src/common/error.ts +19 -1
- package/src/common/index.ts +1 -1
- package/src/data-structures/base/index.ts +1 -0
- package/src/data-structures/base/iterable-element-base.ts +3 -2
- package/src/data-structures/base/iterable-entry-base.ts +8 -8
- package/src/data-structures/base/linear-base.ts +3 -3
- package/src/data-structures/binary-tree/avl-tree.ts +299 -0
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +341 -5
- package/src/data-structures/binary-tree/binary-tree.ts +606 -6
- package/src/data-structures/binary-tree/bst.ts +946 -7
- package/src/data-structures/binary-tree/red-black-tree.ts +472 -0
- package/src/data-structures/binary-tree/segment-tree.ts +145 -2
- package/src/data-structures/binary-tree/tree-map.ts +3423 -499
- package/src/data-structures/binary-tree/tree-multi-map.ts +3537 -596
- package/src/data-structures/binary-tree/tree-multi-set.ts +2855 -495
- package/src/data-structures/binary-tree/tree-set.ts +3209 -413
- package/src/data-structures/graph/abstract-graph.ts +6 -6
- package/src/data-structures/graph/directed-graph.ts +240 -0
- package/src/data-structures/graph/undirected-graph.ts +216 -0
- package/src/data-structures/hash/hash-map.ts +281 -19
- package/src/data-structures/heap/heap.ts +340 -4
- package/src/data-structures/heap/max-heap.ts +2 -2
- package/src/data-structures/linked-list/doubly-linked-list.ts +411 -3
- package/src/data-structures/linked-list/singly-linked-list.ts +363 -3
- package/src/data-structures/linked-list/skip-linked-list.ts +439 -7
- package/src/data-structures/matrix/matrix.ts +202 -10
- package/src/data-structures/priority-queue/max-priority-queue.ts +2 -2
- package/src/data-structures/queue/deque.ts +365 -5
- package/src/data-structures/queue/queue.ts +288 -0
- package/src/data-structures/stack/stack.ts +240 -0
- package/src/data-structures/trie/trie.ts +295 -7
- package/src/interfaces/graph.ts +1 -1
- package/src/types/common.ts +2 -2
- package/src/types/data-structures/binary-tree/bst.ts +1 -0
- package/src/types/data-structures/binary-tree/tree-map.ts +6 -0
- package/src/types/data-structures/binary-tree/tree-multi-set.ts +5 -0
- package/src/types/data-structures/binary-tree/tree-set.ts +5 -0
- package/src/types/data-structures/heap/heap.ts +1 -0
- package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
- package/src/types/utils/validate-type.ts +4 -4
|
@@ -15,7 +15,7 @@ import type {
|
|
|
15
15
|
} from '../../types';
|
|
16
16
|
import { IterableEntryBase } from '../base';
|
|
17
17
|
import { isWeakKey, rangeCheck } from '../../utils';
|
|
18
|
-
import { ERR } from '../../common';
|
|
18
|
+
import { ERR, raise } from '../../common';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Hash-based map. Supports object keys and custom hashing; offers O(1) average set/get/has.
|
|
@@ -180,6 +180,30 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
183
207
|
* @example
|
|
184
208
|
* // Check if empty
|
|
185
209
|
* const map = new HashMap();
|
|
@@ -202,6 +226,30 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
202
226
|
|
|
203
227
|
|
|
204
228
|
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
205
253
|
* @example
|
|
206
254
|
* // Remove all entries
|
|
207
255
|
* const map = new HashMap<string, number>([['a', 1], ['b', 2]]);
|
|
@@ -219,7 +267,7 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
219
267
|
* @remarks Time O(1), Space O(1)
|
|
220
268
|
* @returns True if the value is a 2-tuple.
|
|
221
269
|
*/
|
|
222
|
-
isEntry(rawElement:
|
|
270
|
+
isEntry(rawElement: unknown): rawElement is [K, V] {
|
|
223
271
|
return Array.isArray(rawElement) && rawElement.length === 2;
|
|
224
272
|
}
|
|
225
273
|
|
|
@@ -249,6 +297,54 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
249
297
|
|
|
250
298
|
|
|
251
299
|
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
252
348
|
|
|
253
349
|
|
|
254
350
|
* @example
|
|
@@ -296,6 +392,30 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
296
392
|
|
|
297
393
|
|
|
298
394
|
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
299
419
|
* @example
|
|
300
420
|
* // Add multiple entries
|
|
301
421
|
* const map = new HashMap<string, number>();
|
|
@@ -329,6 +449,30 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
329
449
|
|
|
330
450
|
|
|
331
451
|
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
332
476
|
* @example
|
|
333
477
|
* // HashMap get and has operations
|
|
334
478
|
* const map = new HashMap<string, number>([
|
|
@@ -373,6 +517,30 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
373
517
|
|
|
374
518
|
|
|
375
519
|
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
376
544
|
* @example
|
|
377
545
|
* // Check key existence
|
|
378
546
|
* const map = new HashMap<string, number>([['a', 1], ['b', 2]]);
|
|
@@ -402,6 +570,30 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
402
570
|
|
|
403
571
|
|
|
404
572
|
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
405
597
|
* @example
|
|
406
598
|
* // Remove entries by key
|
|
407
599
|
* const map = new HashMap<string, number>([['x', 10], ['y', 20], ['z', 30]]);
|
|
@@ -450,6 +642,30 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
450
642
|
|
|
451
643
|
|
|
452
644
|
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
453
669
|
* @example
|
|
454
670
|
* // Create independent copy
|
|
455
671
|
* const map = new HashMap<string, number>([['a', 1]]);
|
|
@@ -480,6 +696,30 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
480
696
|
|
|
481
697
|
|
|
482
698
|
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
|
|
483
723
|
* @example
|
|
484
724
|
* // Transform all values
|
|
485
725
|
* const prices = new HashMap<string, number>([['apple', 1], ['banana', 2]]);
|
|
@@ -488,8 +728,8 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
488
728
|
* console.log(doubled.get('apple')); // 2;
|
|
489
729
|
* console.log(doubled.get('banana')); // 4;
|
|
490
730
|
*/
|
|
491
|
-
map<VM>(callbackfn: EntryCallback<K, V, VM>, thisArg?:
|
|
492
|
-
const out = this._createLike<K, VM, [K, VM]>()
|
|
731
|
+
map<VM>(callbackfn: EntryCallback<K, V, VM>, thisArg?: unknown): HashMap<K, VM> {
|
|
732
|
+
const out = this._createLike<K, VM, [K, VM]>() as unknown as HashMap<K, VM>;
|
|
493
733
|
let index = 0;
|
|
494
734
|
for (const [key, value] of this) out.set(key, callbackfn.call(thisArg, value, key, index++, this));
|
|
495
735
|
return out;
|
|
@@ -512,6 +752,30 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
512
752
|
|
|
513
753
|
|
|
514
754
|
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
515
779
|
* @example
|
|
516
780
|
* // HashMap iteration and filter operations
|
|
517
781
|
* const map = new HashMap<number, string>([
|
|
@@ -539,7 +803,7 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
539
803
|
* console.log(values); // contains 7;
|
|
540
804
|
*/
|
|
541
805
|
|
|
542
|
-
filter(predicate: EntryCallback<K, V, boolean>, thisArg?:
|
|
806
|
+
filter(predicate: EntryCallback<K, V, boolean>, thisArg?: unknown): any {
|
|
543
807
|
const out = this._createLike<K, V, [K, V]>();
|
|
544
808
|
let index = 0;
|
|
545
809
|
for (const [key, value] of this) if (predicate.call(thisArg, value, key, index++, this)) out.set(key, value);
|
|
@@ -556,8 +820,8 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
556
820
|
* @param [options] - Options forwarded to the constructor.
|
|
557
821
|
* @returns A like-kind map instance.
|
|
558
822
|
*/
|
|
559
|
-
protected _createLike<TK = K, TV = V, TR = [TK, TV]>(entries: Iterable<[TK, TV] | TR> = [], options?:
|
|
560
|
-
const Ctor = this.constructor as new (e?: Iterable<[TK, TV] | TR>, o?:
|
|
823
|
+
protected _createLike<TK = K, TV = V, TR = [TK, TV]>(entries: Iterable<[TK, TV] | TR> = [], options?: Record<string, unknown>): this {
|
|
824
|
+
const Ctor = this.constructor as new (e?: Iterable<[TK, TV] | TR>, o?: Record<string, unknown>) => this;
|
|
561
825
|
return new Ctor(entries, options);
|
|
562
826
|
}
|
|
563
827
|
|
|
@@ -575,7 +839,7 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|
|
575
839
|
for (const node of this.objMap) yield node as [K, V];
|
|
576
840
|
}
|
|
577
841
|
|
|
578
|
-
protected _isObjKey(key:
|
|
842
|
+
protected _isObjKey(key: unknown): key is object | ((...args: unknown[]) => unknown) {
|
|
579
843
|
const keyType = typeof key;
|
|
580
844
|
return (keyType === 'object' || keyType === 'function') && key !== null;
|
|
581
845
|
}
|
|
@@ -688,9 +952,7 @@ export class LinkedHashMap<K = any, V = any, R = [K, V]> extends IterableEntryBa
|
|
|
688
952
|
if (this.isEntry(rawElement)) {
|
|
689
953
|
return rawElement;
|
|
690
954
|
}
|
|
691
|
-
|
|
692
|
-
ERR.invalidArgument('If elements do not adhere to [key, value], provide options.toEntryFn to transform raw records.', 'HashMap')
|
|
693
|
-
);
|
|
955
|
+
raise(TypeError, ERR.invalidArgument('If elements do not adhere to [key, value], provide options.toEntryFn to transform raw records.', 'HashMap'));
|
|
694
956
|
};
|
|
695
957
|
|
|
696
958
|
get toEntryFn() {
|
|
@@ -897,7 +1159,7 @@ export class LinkedHashMap<K = any, V = any, R = [K, V]> extends IterableEntryBa
|
|
|
897
1159
|
return this._size === 0;
|
|
898
1160
|
}
|
|
899
1161
|
|
|
900
|
-
isEntry(rawElement:
|
|
1162
|
+
isEntry(rawElement: unknown): rawElement is [K, V] {
|
|
901
1163
|
return Array.isArray(rawElement) && rawElement.length === 2;
|
|
902
1164
|
}
|
|
903
1165
|
|
|
@@ -907,12 +1169,12 @@ export class LinkedHashMap<K = any, V = any, R = [K, V]> extends IterableEntryBa
|
|
|
907
1169
|
this._head = this._tail = this._sentinel.prev = this._sentinel.next = this._sentinel;
|
|
908
1170
|
}
|
|
909
1171
|
|
|
910
|
-
clone():
|
|
1172
|
+
clone(): this {
|
|
911
1173
|
const opts = { hashFn: this._hashFn, objHashFn: this._objHashFn };
|
|
912
|
-
return this._createLike<
|
|
1174
|
+
return this._createLike<K, V, [K, V]>(this, opts);
|
|
913
1175
|
}
|
|
914
1176
|
|
|
915
|
-
filter(predicate: EntryCallback<K, V, boolean>, thisArg?:
|
|
1177
|
+
filter(predicate: EntryCallback<K, V, boolean>, thisArg?: unknown): this {
|
|
916
1178
|
const out = this._createLike<K, V, [K, V]>();
|
|
917
1179
|
let index = 0;
|
|
918
1180
|
for (const [key, value] of this) {
|
|
@@ -931,8 +1193,8 @@ export class LinkedHashMap<K = any, V = any, R = [K, V]> extends IterableEntryBa
|
|
|
931
1193
|
* @param [thisArg] - Value for `this` inside the callback.
|
|
932
1194
|
* @returns A new map of the same class with transformed entries.
|
|
933
1195
|
*/
|
|
934
|
-
map<MK, MV>(callback: EntryCallback<K, V, [MK, MV]>, thisArg?:
|
|
935
|
-
const out = this._createLike<MK, MV, [MK, MV]>()
|
|
1196
|
+
map<MK, MV>(callback: EntryCallback<K, V, [MK, MV]>, thisArg?: unknown): LinkedHashMap<MK, MV> {
|
|
1197
|
+
const out = this._createLike<MK, MV, [MK, MV]>() as unknown as LinkedHashMap<MK, MV>;
|
|
936
1198
|
let index = 0;
|
|
937
1199
|
for (const [key, value] of this) {
|
|
938
1200
|
const [newKey, newValue] = callback.call(thisArg, value, key, index, this);
|
|
@@ -972,8 +1234,8 @@ export class LinkedHashMap<K = any, V = any, R = [K, V]> extends IterableEntryBa
|
|
|
972
1234
|
return true;
|
|
973
1235
|
}
|
|
974
1236
|
|
|
975
|
-
protected _createLike<TK = K, TV = V, TR = [TK, TV]>(entries: Iterable<[TK, TV] | TR> = [], options?:
|
|
976
|
-
const Ctor = this.constructor as new (e?: Iterable<[TK, TV] | TR>, o?:
|
|
1237
|
+
protected _createLike<TK = K, TV = V, TR = [TK, TV]>(entries: Iterable<[TK, TV] | TR> = [], options?: Record<string, unknown>): this {
|
|
1238
|
+
const Ctor = this.constructor as new (e?: Iterable<[TK, TV] | TR>, o?: Record<string, unknown>) => this;
|
|
977
1239
|
return new Ctor(entries, options);
|
|
978
1240
|
}
|
|
979
1241
|
}
|