@@ -73,10 +73,7 @@ export async function preTranspileScriptSetup(sfc: SFCDescriptor, id: string): P
73
73
}
74
74
}
75
75
76
- function processDefineProps (
77
- node : Expression ,
78
- context : Context ,
79
- ) : string | undefined {
76
+ function processDefineProps ( node : Expression , context : Context ) : string | undefined {
80
77
if ( ! isCallOf ( node , DEFINE_PROPS ) ) {
81
78
return
82
79
}
@@ -114,10 +111,7 @@ function processDefineProps(
114
111
115
112
return generate ( node ) . code
116
113
}
117
- function processDefineEmits (
118
- node : Expression ,
119
- context : Context ,
120
- ) : string | undefined {
114
+ function processDefineEmits ( node : Expression , context : Context ) : string | undefined {
121
115
if ( ! isCallOf ( node , DEFINE_EMITS ) ) {
122
116
return
123
117
}
@@ -154,10 +148,7 @@ function processDefineEmits(
154
148
155
149
return generate ( node ) . code
156
150
}
157
- function processWithDefaults (
158
- node : Expression ,
159
- context : Context ,
160
- ) : string | undefined {
151
+ function processWithDefaults ( node : Expression , context : Context ) : string | undefined {
161
152
if ( ! isCallOf ( node , WITH_DEFAULTS ) ) {
162
153
return
163
154
}
@@ -187,10 +178,7 @@ function processWithDefaults(
187
178
188
179
return res
189
180
}
190
- function processDefineModel (
191
- node : Expression ,
192
- context : Context ,
193
- ) : string | undefined {
181
+ function processDefineModel ( node : Expression , context : Context ) : string | undefined {
194
182
if ( ! isCallOf ( node , DEFINE_MODEL ) ) {
195
183
return
196
184
}
@@ -249,10 +237,7 @@ function processDefineModel(
249
237
return generate ( node ) . code
250
238
}
251
239
252
- function getDefineModelRuntimeDecl (
253
- node : CallExpression ,
254
- context : Context ,
255
- ) : [ StringLiteral | undefined , ObjectExpression | undefined ] {
240
+ function getDefineModelRuntimeDecl ( node : CallExpression , context : Context ) : [ StringLiteral | undefined , ObjectExpression | undefined ] {
256
241
const [ arg0 , arg1 ] = node . arguments
257
242
if ( arg0 && arg0 . type === 'StringLiteral' ) {
258
243
if ( arg1 && arg1 . type !== 'ObjectExpression' ) {
@@ -272,10 +257,7 @@ function getDefineModelRuntimeDecl(
272
257
return [ undefined , arg0 as ObjectExpression | undefined ]
273
258
}
274
259
275
- async function prepareContext (
276
- { script, scriptSetup } : SFCDescriptor & { scriptSetup : SFCScriptBlock } ,
277
- id : string ,
278
- ) : Promise < Context > {
260
+ async function prepareContext ( { script, scriptSetup } : SFCDescriptor & { scriptSetup : SFCScriptBlock } , id : string ) : Promise < Context > {
279
261
const { extractRuntimeProps, extractRuntimeEmits, inferRuntimeType, MagicString } = await import ( 'vue/compiler-sfc' )
280
262
281
263
const helper = new Set < string > ( )
0 commit comments