Skip to content

Commit

Permalink
feat: supports more typescript expression
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Aug 12, 2022
1 parent da991bc commit 10a4557
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,11 @@ function transformJsx(code: string, node: JSX) {
)
return expressions.slice(-1)[0]
}
case 'TSNonNullExpression':
case 'ParenthesizedExpression': // (1)
case 'TSNonNullExpression': // 1!
case 'TSAsExpression': // 1 as number
case 'TSTypeAssertion': // (<number>2)
case 'TSInstantiationExpression': // '1'<string>
return resolveExpression(node.expression, node)
case 'CallExpression':
return resolveCallExpression(node, !parent)
Expand Down

1 comment on commit 10a4557

@vercel
Copy link

@vercel vercel bot commented on 10a4557 Aug 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.