Skip to content

Commit

Permalink
feat: support satisfies operator
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Jan 26, 2023
1 parent 220e3ab commit 289f719
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/compiler-core/src/babelUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ export function walkIdentifiers(
if (
parent &&
parent.type.startsWith('TS') &&
parent.type !== 'TSAsExpression' &&
parent.type !== 'TSNonNullExpression' &&
parent.type !== 'TSTypeAssertion'
!TS_NODE_TYPES.includes(parent.type)
) {
return this.skip()
}
Expand Down Expand Up @@ -424,10 +422,11 @@ function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean {
}

export const TS_NODE_TYPES = [
'TSNonNullExpression', // foo!
'TSAsExpression', // foo as number
'TSTypeAssertion', // (<number>foo)
'TSInstantiationExpression' // foo<string>
'TSNonNullExpression', // foo!
'TSInstantiationExpression', // foo<string>
'TSSatisfiesExpression' // foo satisfies T
]
export function unwrapTSNode(node: Node): Node {
if (TS_NODE_TYPES.includes(node.type)) {
Expand Down

0 comments on commit 289f719

Please sign in to comment.