Skip to content

Commit

Permalink
feat: supports SequenceExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Jun 18, 2022
1 parent 2908bbd commit 46bcdf2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/convert.ts
Expand Up @@ -243,6 +243,12 @@ function transformJsx(code: string, node: JSX) {
return resolveExpression(node.test)
? resolveExpression(node.consequent)
: resolveExpression(node.alternate)
case 'SequenceExpression': {
const expressions = node.expressions.map((expr) =>
resolveExpression(expr)
)
return expressions.slice(-1)[0]
}
default:
return notSupported(node)
}
Expand Down

0 comments on commit 46bcdf2

Please sign in to comment.