File tree Expand file tree Collapse file tree 3 files changed +30
-8
lines changed
packages/graphql/lib/schema-builder Expand file tree Collapse file tree 3 files changed +30
-8
lines changed Original file line number Diff line number Diff line change 1
- export class ArrayCollection < T > extends Array < T > {
2
- constructor ( private globalArray : Array < T > ) {
3
- super ( ) ;
1
+ export class ArrayCollection < T > {
2
+ private array : T [ ] = [ ] ;
3
+
4
+ constructor ( private globalArray : Array < T > ) { }
5
+
6
+ getAll ( ) {
7
+ return this . array ;
4
8
}
5
9
6
10
push ( ...items ) : number {
7
11
this . globalArray . push ( ...items ) ;
8
- return super . push ( ...items ) ;
12
+ return this . array . push ( ...items ) ;
9
13
}
10
14
11
15
unshift ( ...items ) : number {
12
16
this . globalArray . unshift ( ...items ) ;
13
- return super . unshift ( ...items ) ;
17
+ return this . array . unshift ( ...items ) ;
18
+ }
19
+
20
+ reverse ( ) {
21
+ return this . array . reverse ( ) ;
22
+ }
23
+
24
+ reduce < U > (
25
+ callbackfn : (
26
+ previousValue : U ,
27
+ currentValue : T ,
28
+ currentIndex : number ,
29
+ array : T [ ] ,
30
+ ) => U ,
31
+ initialValue : U ,
32
+ ) : U {
33
+ return this . array . reduce ( callbackfn , initialValue ) ;
14
34
}
15
35
}
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ export class MetadataStorageCollectionList {
30
30
}
31
31
32
32
compile ( ) {
33
- this . reversePredicate ( ( t ) => t . classDirectives ) ;
34
- this . reversePredicate ( ( t ) => t . classExtensions ) ;
33
+ this . reversePredicate ( ( t ) => t . classDirectives . getAll ( ) ) ;
34
+ this . reversePredicate ( ( t ) => t . classExtensions . getAll ( ) ) ;
35
35
this . reversePredicate ( ( t ) => t . fieldDirectives . getAll ( ) ) ;
36
36
this . reversePredicate ( ( t ) => t . fieldExtensions . getAll ( ) ) ;
37
37
}
Original file line number Diff line number Diff line change @@ -257,7 +257,9 @@ export class TypeMetadataStorageHost {
257
257
item . properties = this . getClassFieldsByPredicate ( item ) ;
258
258
}
259
259
if ( ! item . directives ) {
260
- item . directives = this . targets . get ( item . target ) . classDirectives ;
260
+ item . directives = this . targets
261
+ . get ( item . target )
262
+ . classDirectives . getAll ( ) ;
261
263
}
262
264
if ( ! item . extensions ) {
263
265
item . extensions = this . targets
You can’t perform that action at this time.
0 commit comments