File tree 1 file changed +3
-5
lines changed
packages/language-core/lib/codegen/script
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,12 @@ export function* generateStyleModulesType(
8
8
options : ScriptCodegenOptions ,
9
9
ctx : ScriptCodegenContext
10
10
) : Generator < Code > {
11
- const styles = options . sfc . styles . filter ( style => style . module ) ;
11
+ const styles = options . sfc . styles . map ( ( style , i ) => [ style , i ] as const ) . filter ( ( [ style ] ) => style . module ) ;
12
12
if ( ! styles . length ) {
13
13
return ;
14
14
}
15
15
yield `type __VLS_StyleModules = {${ newLine } ` ;
16
- for ( let i = 0 ; i < styles . length ; i ++ ) {
17
- const style = styles [ i ] ;
16
+ for ( const [ style , i ] of styles ) {
18
17
const { name, offset } = style . module ! ;
19
18
if ( offset ) {
20
19
yield [
@@ -39,6 +38,5 @@ export function* generateStyleModulesType(
39
38
}
40
39
yield `>${ endOfLine } ` ;
41
40
}
42
- yield `}` ;
43
- yield endOfLine ;
41
+ yield `}${ endOfLine } ` ;
44
42
}
You can’t perform that action at this time.
0 commit comments