@@ -322,17 +322,31 @@ const buildProps = (path: NodePath<t.JSXElement>, state: State) => {
322
322
) ;
323
323
if ( optimize ) {
324
324
if ( hasClassBinding ) {
325
- const klass = propsExpression . properties
326
- . find ( ( prop ) => t . isObjectProperty ( prop ) && t . isStringLiteral ( prop . key ) && prop . key . value === 'class' ) ;
325
+ const klass = propsExpression . properties . find (
326
+ ( prop ) =>
327
+ t . isObjectProperty ( prop ) &&
328
+ t . isStringLiteral ( prop . key ) &&
329
+ prop . key . value === 'class'
330
+ ) ;
327
331
if ( t . isObjectProperty ( klass ) ) {
328
- klass . value = t . callExpression ( createIdentifier ( state , 'normalizeClass' ) , [ klass . value as any ] ) ;
332
+ klass . value = t . callExpression (
333
+ createIdentifier ( state , 'normalizeClass' ) ,
334
+ [ klass . value as any ]
335
+ ) ;
329
336
}
330
337
}
331
338
if ( hasStyleBinding ) {
332
- const style = propsExpression . properties
333
- . find ( ( prop ) => t . isObjectProperty ( prop ) && t . isStringLiteral ( prop . key ) && prop . key . value === 'style' ) ;
339
+ const style = propsExpression . properties . find (
340
+ ( prop ) =>
341
+ t . isObjectProperty ( prop ) &&
342
+ t . isStringLiteral ( prop . key ) &&
343
+ prop . key . value === 'style'
344
+ ) ;
334
345
if ( t . isObjectProperty ( style ) ) {
335
- style . value = t . callExpression ( createIdentifier ( state , 'normalizeStyle' ) , [ style . value as any ] ) ;
346
+ style . value = t . callExpression (
347
+ createIdentifier ( state , 'normalizeStyle' ) ,
348
+ [ style . value as any ]
349
+ ) ;
336
350
}
337
351
}
338
352
}
@@ -570,18 +584,22 @@ const transformJSXElement = (
570
584
571
585
const createVNode = t . callExpression (
572
586
optimize
573
- ? createIdentifier ( state , isComponent ? 'createVNode' : 'createElementVNode' )
587
+ ? createIdentifier (
588
+ state ,
589
+ isComponent ? 'createVNode' : 'createElementVNode'
590
+ )
574
591
: createIdentifier ( state , 'createVNode' ) ,
575
592
[
576
593
tag ,
577
594
props ,
578
595
VNodeChild || t . nullLiteral ( ) ,
579
596
! ! patchFlag && optimize && t . numericLiteral ( patchFlag ) ,
580
- ! ! dynamicPropNames . size && optimize &&
597
+ ! ! dynamicPropNames . size &&
598
+ optimize &&
581
599
t . arrayExpression (
582
600
[ ...dynamicPropNames . keys ( ) ] . map ( ( name ) => t . stringLiteral ( name ) )
583
- ) ,
584
- ] . filter ( Boolean as unknown as ExcludesBoolean ) ,
601
+ ) ,
602
+ ] . filter ( Boolean as unknown as ExcludesBoolean )
585
603
) ;
586
604
587
605
if ( ! directives . length ) {
0 commit comments