@@ -88,39 +88,27 @@ export class TypeInfo {
8888 }
8989
9090 getType ( ) : Maybe < GraphQLOutputType > {
91- if ( this . _typeStack . length > 0 ) {
92- return this . _typeStack [ this . _typeStack . length - 1 ] ;
93- }
91+ return this . _typeStack . at ( - 1 ) ;
9492 }
9593
9694 getParentType ( ) : Maybe < GraphQLCompositeType > {
97- if ( this . _parentTypeStack . length > 0 ) {
98- return this . _parentTypeStack [ this . _parentTypeStack . length - 1 ] ;
99- }
95+ return this . _parentTypeStack . at ( - 1 ) ;
10096 }
10197
10298 getInputType ( ) : Maybe < GraphQLInputType > {
103- if ( this . _inputTypeStack . length > 0 ) {
104- return this . _inputTypeStack [ this . _inputTypeStack . length - 1 ] ;
105- }
99+ return this . _inputTypeStack . at ( - 1 ) ;
106100 }
107101
108102 getParentInputType ( ) : Maybe < GraphQLInputType > {
109- if ( this . _inputTypeStack . length > 1 ) {
110- return this . _inputTypeStack [ this . _inputTypeStack . length - 2 ] ;
111- }
103+ return this . _inputTypeStack . at ( - 2 ) ;
112104 }
113105
114106 getFieldDef ( ) : Maybe < GraphQLField < unknown , unknown > > {
115- if ( this . _fieldDefStack . length > 0 ) {
116- return this . _fieldDefStack [ this . _fieldDefStack . length - 1 ] ;
117- }
107+ return this . _fieldDefStack . at ( - 1 ) ;
118108 }
119109
120110 getDefaultValue ( ) : Maybe < unknown > {
121- if ( this . _defaultValueStack . length > 0 ) {
122- return this . _defaultValueStack [ this . _defaultValueStack . length - 1 ] ;
123- }
111+ return this . _defaultValueStack . at ( - 1 ) ;
124112 }
125113
126114 getDirective ( ) : Maybe < GraphQLDirective > {
0 commit comments