1
1
import {
2
2
Collection ,
3
- KeyedCollection ,
4
- IndexedCollection ,
5
- SetCollection ,
3
+ CollectionImpl ,
4
+ IndexedCollectionImpl ,
5
+ KeyedCollectionImpl ,
6
+ SetCollectionImpl ,
6
7
} from './Collection' ;
7
- import { IS_COLLECTION_SYMBOL } from './predicates/isCollection' ;
8
- import { isKeyed , IS_KEYED_SYMBOL } from './predicates/isKeyed' ;
9
- import { isIndexed , IS_INDEXED_SYMBOL } from './predicates/isIndexed' ;
10
- import { isOrdered , IS_ORDERED_SYMBOL } from './predicates/isOrdered' ;
11
- import { is } from './is' ;
12
- import {
13
- NOT_SET ,
14
- ensureSize ,
15
- wrapIndex ,
16
- returnTrue ,
17
- resolveBegin ,
18
- } from './TrieUtils' ;
19
8
import { hash } from './Hash' ;
20
- import { imul , smi } from './Math ' ;
9
+ import { is } from './is ' ;
21
10
import {
22
- Iterator ,
23
- ITERATOR_SYMBOL ,
11
+ ITERATE_ENTRIES ,
24
12
ITERATE_KEYS ,
25
13
ITERATE_VALUES ,
26
- ITERATE_ENTRIES ,
14
+ Iterator ,
15
+ ITERATOR_SYMBOL ,
27
16
} from './Iterator' ;
17
+ import { imul , smi } from './Math' ;
18
+ import { IS_COLLECTION_SYMBOL } from './predicates/isCollection' ;
19
+ import { IS_INDEXED_SYMBOL , isIndexed } from './predicates/isIndexed' ;
20
+ import { IS_KEYED_SYMBOL , isKeyed } from './predicates/isKeyed' ;
21
+ import { IS_ORDERED_SYMBOL , isOrdered } from './predicates/isOrdered' ;
22
+ import {
23
+ ensureSize ,
24
+ NOT_SET ,
25
+ resolveBegin ,
26
+ returnTrue ,
27
+ wrapIndex ,
28
+ } from './TrieUtils' ;
28
29
29
30
import arrCopy from './utils/arrCopy' ;
30
31
import assertNotInfinite from './utils/assertNotInfinite' ;
31
32
import deepEqual from './utils/deepEqual' ;
32
33
import mixin from './utils/mixin' ;
33
34
import quoteString from './utils/quoteString' ;
34
35
35
- import { toJS } from './toJS' ;
36
- import { Map } from './Map' ;
37
- import { OrderedMap } from './OrderedMap' ;
38
36
import { List } from './List' ;
39
- import { Set } from './Set' ;
40
- import { OrderedSet } from './OrderedSet' ;
41
- import { Stack } from './Stack' ;
42
- import { Range } from './Range' ;
43
- import { KeyedSeq , IndexedSeq , SetSeq , ArraySeq } from './Seq' ;
37
+ import { Map } from './Map' ;
38
+ import { getIn } from './methods/getIn' ;
39
+ import { hasIn } from './methods/hasIn' ;
40
+ import { toObject } from './methods/toObject' ;
44
41
import {
45
- reify ,
46
- ToKeyedSequence ,
47
- ToIndexedSequence ,
48
- ToSetSequence ,
49
- FromEntriesSequence ,
42
+ concatFactory ,
43
+ countByFactory ,
44
+ filterFactory ,
45
+ flatMapFactory ,
46
+ flattenFactory ,
50
47
flipFactory ,
48
+ FromEntriesSequence ,
49
+ groupByFactory ,
50
+ interposeFactory ,
51
51
mapFactory ,
52
+ maxFactory ,
53
+ partitionFactory ,
54
+ reify ,
52
55
reverseFactory ,
53
- filterFactory ,
54
- countByFactory ,
55
- groupByFactory ,
56
- sliceFactory ,
57
- takeWhileFactory ,
58
56
skipWhileFactory ,
59
- concatFactory ,
60
- flattenFactory ,
61
- flatMapFactory ,
62
- interposeFactory ,
57
+ sliceFactory ,
63
58
sortFactory ,
64
- maxFactory ,
59
+ takeWhileFactory ,
60
+ ToIndexedSequence ,
61
+ ToKeyedSequence ,
62
+ ToSetSequence ,
65
63
zipWithFactory ,
66
- partitionFactory ,
67
64
} from './Operations' ;
68
- import { getIn } from './methods/getIn' ;
69
- import { hasIn } from './methods/hasIn' ;
70
- import { toObject } from './methods/toObject' ;
65
+ import { OrderedMap } from './OrderedMap' ;
66
+ import { OrderedSet } from './OrderedSet' ;
67
+ import { Range } from './Range' ;
68
+ import {
69
+ ArraySeq ,
70
+ IndexedSeq ,
71
+ IndexedSeqImpl ,
72
+ KeyedSeqImpl ,
73
+ SetSeqImpl ,
74
+ } from './Seq' ;
75
+ import { Set } from './Set' ;
76
+ import { Stack } from './Stack' ;
77
+ import { toJS } from './toJS' ;
71
78
72
79
export { Collection , CollectionPrototype , IndexedCollectionPrototype } ;
73
80
74
81
Collection . Iterator = Iterator ;
75
82
76
- mixin ( Collection , {
83
+ mixin ( CollectionImpl , {
77
84
// ### Conversion to other types
78
85
79
86
toArray ( ) {
@@ -490,7 +497,7 @@ mixin(Collection, {
490
497
// abstract __iterator(type, reverse)
491
498
} ) ;
492
499
493
- const CollectionPrototype = Collection . prototype ;
500
+ const CollectionPrototype = CollectionImpl . prototype ;
494
501
CollectionPrototype [ IS_COLLECTION_SYMBOL ] = true ;
495
502
CollectionPrototype [ ITERATOR_SYMBOL ] = CollectionPrototype . values ;
496
503
CollectionPrototype . toJSON = CollectionPrototype . toArray ;
@@ -501,7 +508,7 @@ CollectionPrototype.inspect = CollectionPrototype.toSource = function () {
501
508
CollectionPrototype . chain = CollectionPrototype . flatMap ;
502
509
CollectionPrototype . contains = CollectionPrototype . includes ;
503
510
504
- mixin ( KeyedCollection , {
511
+ mixin ( KeyedCollectionImpl , {
505
512
// ### More sequential methods
506
513
507
514
flip ( ) {
@@ -529,14 +536,14 @@ mixin(KeyedCollection, {
529
536
} ,
530
537
} ) ;
531
538
532
- const KeyedCollectionPrototype = KeyedCollection . prototype ;
539
+ const KeyedCollectionPrototype = KeyedCollectionImpl . prototype ;
533
540
KeyedCollectionPrototype [ IS_KEYED_SYMBOL ] = true ;
534
541
KeyedCollectionPrototype [ ITERATOR_SYMBOL ] = CollectionPrototype . entries ;
535
542
KeyedCollectionPrototype . toJSON = toObject ;
536
543
KeyedCollectionPrototype . __toStringMapper = ( v , k ) =>
537
544
quoteString ( k ) + ': ' + quoteString ( v ) ;
538
545
539
- mixin ( IndexedCollection , {
546
+ mixin ( IndexedCollectionImpl , {
540
547
// ### Conversion to other types
541
548
542
549
toKeyedSeq ( ) {
@@ -668,11 +675,11 @@ mixin(IndexedCollection, {
668
675
} ,
669
676
} ) ;
670
677
671
- const IndexedCollectionPrototype = IndexedCollection . prototype ;
678
+ const IndexedCollectionPrototype = IndexedCollectionImpl . prototype ;
672
679
IndexedCollectionPrototype [ IS_INDEXED_SYMBOL ] = true ;
673
680
IndexedCollectionPrototype [ IS_ORDERED_SYMBOL ] = true ;
674
681
675
- mixin ( SetCollection , {
682
+ mixin ( SetCollectionImpl , {
676
683
// ### ES6 Collection methods (ES6 Array and Map)
677
684
678
685
get ( value , notSetValue ) {
@@ -690,16 +697,16 @@ mixin(SetCollection, {
690
697
} ,
691
698
} ) ;
692
699
693
- const SetCollectionPrototype = SetCollection . prototype ;
700
+ const SetCollectionPrototype = SetCollectionImpl . prototype ;
694
701
SetCollectionPrototype . has = CollectionPrototype . includes ;
695
702
SetCollectionPrototype . contains = SetCollectionPrototype . includes ;
696
703
SetCollectionPrototype . keys = SetCollectionPrototype . values ;
697
704
698
705
// Mixin subclasses
699
706
700
- mixin ( KeyedSeq , KeyedCollectionPrototype ) ;
701
- mixin ( IndexedSeq , IndexedCollectionPrototype ) ;
702
- mixin ( SetSeq , SetCollectionPrototype ) ;
707
+ mixin ( KeyedSeqImpl , KeyedCollectionPrototype ) ;
708
+ mixin ( IndexedSeqImpl , IndexedCollectionPrototype ) ;
709
+ mixin ( SetSeqImpl , SetCollectionPrototype ) ;
703
710
704
711
// #pragma Helper functions
705
712
0 commit comments