From 25114151216a54c7c0917cbb36b5f87f39057d4c Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Sat, 17 Jun 2023 15:20:01 +0200 Subject: [PATCH] Replace destructuring syntax --- lib/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/index.js b/lib/index.js index 43e10bc..d31088c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -312,11 +312,10 @@ export function buildJsx(tree, options) { const attribute = attributes[index] if (attribute.type === 'JSXSpreadAttribute') { - const {argument} = attribute - if (argument.type === 'ObjectExpression') { - fields.push(...argument.properties) + if (attribute.argument.type === 'ObjectExpression') { + fields.push(...attribute.argument.properties) } else { - fields.push({type: 'SpreadElement', argument}) + fields.push({type: 'SpreadElement', argument: attribute.argument}) } spread = true