Skip to content

Commit 289f719

Browse files
committed
feat: support satisfies operator
1 parent 220e3ab commit 289f719

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/compiler-core/src/babelUtils.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ export function walkIdentifiers(
3838
if (
3939
parent &&
4040
parent.type.startsWith('TS') &&
41-
parent.type !== 'TSAsExpression' &&
42-
parent.type !== 'TSNonNullExpression' &&
43-
parent.type !== 'TSTypeAssertion'
41+
!TS_NODE_TYPES.includes(parent.type)
4442
) {
4543
return this.skip()
4644
}
@@ -424,10 +422,11 @@ function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean {
424422
}
425423

426424
export const TS_NODE_TYPES = [
427-
'TSNonNullExpression', // foo!
428425
'TSAsExpression', // foo as number
429426
'TSTypeAssertion', // (<number>foo)
430-
'TSInstantiationExpression' // foo<string>
427+
'TSNonNullExpression', // foo!
428+
'TSInstantiationExpression', // foo<string>
429+
'TSSatisfiesExpression' // foo satisfies T
431430
]
432431
export function unwrapTSNode(node: Node): Node {
433432
if (TS_NODE_TYPES.includes(node.type)) {

0 commit comments

Comments
 (0)