File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -308,17 +308,23 @@ async function removeTypesFromVueSfcScript(
308
308
enter ( node ) {
309
309
let content = "" ;
310
310
if ( isVueSimpleExpressionNode ( node ) && ! node . isStatic ) {
311
- const ForOfOrInRE = / \s * ( o f | i n ) \s * / ;
311
+ const ForOfOrInRE = / \s + ( o f | i n ) \s + / ;
312
312
if ( node . content . match ( ForOfOrInRE ) ) {
313
313
const parts = node . content . split ( ForOfOrInRE ) ;
314
- content = parts [ parts . length - 1 ] ;
314
+ if ( parts . length === 3 ) {
315
+ content = parts [ parts . length - 1 ] ;
316
+ } else {
317
+ content = node . content ;
318
+ }
315
319
} else {
316
320
content = node . content ;
317
321
}
318
322
} else if ( isVueComponentNode ( node ) ) {
319
323
content = node . tag ;
320
324
}
321
- expressions . add ( `[${ content } ]` ) ;
325
+ if ( content ) {
326
+ expressions . add ( `[${ content } ]` ) ;
327
+ }
322
328
} ,
323
329
} ) ;
324
330
You can’t perform that action at this time.
0 commit comments