File tree 2 files changed +12
-4
lines changed
packages/apollo-gateway/src
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -138,12 +138,12 @@ function mergeFieldNodeSelectionSets(
138
138
) : SelectionNode [ ] {
139
139
const [ fieldNodes , fragmentNodes ] = partition (
140
140
selectionNodes ,
141
- ( node : SelectionNode ) : node is FieldNode => node . kind === Kind . FIELD ,
141
+ ( node ) : node is FieldNode => node . kind === Kind . FIELD ,
142
142
) ;
143
143
144
144
const [ aliasedFieldNodes , nonAliasedFieldNodes ] = partition (
145
145
fieldNodes ,
146
- ( node : FieldNode ) : node is FieldNode => ! ! node . alias ,
146
+ node => ! ! node . alias ,
147
147
) ;
148
148
149
149
const mergedFieldNodes = Array . from (
Original file line number Diff line number Diff line change @@ -19,7 +19,15 @@ export function compactMap<T, U>(
19
19
export function partition < T , U extends T > (
20
20
array : T [ ] ,
21
21
predicate : ( element : T , index : number , array : T [ ] ) => element is U ,
22
- ) : [ U [ ] , T [ ] ] {
22
+ ) : [ U [ ] , T [ ] ] ;
23
+ export function partition < T > (
24
+ array : T [ ] ,
25
+ predicate : ( element : T , index : number , array : T [ ] ) => boolean ,
26
+ ) : [ T [ ] , T [ ] ] ;
27
+ export function partition < T > (
28
+ array : T [ ] ,
29
+ predicate : ( element : T , index : number , array : T [ ] ) => boolean ,
30
+ ) : [ T [ ] , T [ ] ] {
23
31
array . map ;
24
32
return array . reduce (
25
33
( accumulator , element , index ) => {
@@ -30,7 +38,7 @@ export function partition<T, U extends T>(
30
38
accumulator
31
39
) ;
32
40
} ,
33
- [ [ ] , [ ] ] as [ U [ ] , T [ ] ] ,
41
+ [ [ ] , [ ] ] as [ T [ ] , T [ ] ] ,
34
42
) ;
35
43
}
36
44
You can’t perform that action at this time.
0 commit comments