Skip to content

Commit

Permalink
feat: supports ConditionalExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Jun 18, 2022
1 parent 2f7c916 commit 2908bbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ function transformJsx(code: string, node: JSX) {
return resolveBinary(node)
case 'UnaryExpression':
return resolveUnaryExpression(node)
case 'ConditionalExpression':
return resolveExpression(node.test)
? resolveExpression(node.consequent)
: resolveExpression(node.alternate)
default:
return notSupported(node)
}
Expand Down

0 comments on commit 2908bbd

Please sign in to comment.