@@ -143,6 +143,7 @@ const SharedVisitorKeys = (() => {
143
143
return {
144
144
AbstractPropertyDefinition : [ 'decorators' , 'key' , 'typeAnnotation' ] ,
145
145
AnonymousFunction,
146
+ AsExpression : [ 'expression' , 'typeAnnotation' ] ,
146
147
ClassDeclaration : [
147
148
'decorators' ,
148
149
'id' ,
@@ -155,7 +156,6 @@ const SharedVisitorKeys = (() => {
155
156
Function : [ 'id' , ...AnonymousFunction ] ,
156
157
FunctionType,
157
158
PropertyDefinition : [ ...AbstractPropertyDefinition , 'value' ] ,
158
- TypeAssertion : [ 'expression' , 'typeAnnotation' ] ,
159
159
} as const ;
160
160
} ) ( ) ;
161
161
@@ -193,7 +193,7 @@ const additionalKeys: AdditionalKeys = {
193
193
TSAbstractPropertyDefinition : SharedVisitorKeys . AbstractPropertyDefinition ,
194
194
TSAnyKeyword : [ ] ,
195
195
TSArrayType : [ 'elementType' ] ,
196
- TSAsExpression : SharedVisitorKeys . TypeAssertion ,
196
+ TSAsExpression : SharedVisitorKeys . AsExpression ,
197
197
TSAsyncKeyword : [ ] ,
198
198
TSBigIntKeyword : [ ] ,
199
199
TSBooleanKeyword : [ ] ,
@@ -244,12 +244,7 @@ const additionalKeys: AdditionalKeys = {
244
244
TSQualifiedName : [ 'left' , 'right' ] ,
245
245
TSReadonlyKeyword : [ ] ,
246
246
TSRestType : [ 'typeAnnotation' ] ,
247
- TSSatisfiesExpression : [
248
- // this is intentionally different to SharedVisitorKeys.TypeAssertion because
249
- // the type annotation comes first in the source code
250
- 'typeAnnotation' ,
251
- 'expression' ,
252
- ] ,
247
+ TSSatisfiesExpression : SharedVisitorKeys . AsExpression ,
253
248
TSStaticKeyword : [ ] ,
254
249
TSStringKeyword : [ ] ,
255
250
TSSymbolKeyword : [ ] ,
@@ -258,7 +253,7 @@ const additionalKeys: AdditionalKeys = {
258
253
TSTupleType : [ 'elementTypes' ] ,
259
254
TSTypeAliasDeclaration : [ 'id' , 'typeParameters' , 'typeAnnotation' ] ,
260
255
TSTypeAnnotation : [ 'typeAnnotation' ] ,
261
- TSTypeAssertion : SharedVisitorKeys . TypeAssertion ,
256
+ TSTypeAssertion : [ 'typeAnnotation' , 'expression' ] ,
262
257
TSTypeLiteral : [ 'members' ] ,
263
258
TSTypeOperator : [ 'typeAnnotation' ] ,
264
259
TSTypeParameter : [ 'name' , 'constraint' , 'default' ] ,
0 commit comments