@@ -96,7 +96,7 @@ export async function codemodLegacyNodes(params: Params): Promise<SvelteAST.Root
9696 return transformed ;
9797 }
9898
99- return node ;
99+ return node as any ;
100100 } ,
101101
102102 ExportNamedDeclaration ( node , context ) {
@@ -235,7 +235,7 @@ export async function codemodLegacyNodes(params: Params): Promise<SvelteAST.Root
235235
236236 state . currentScript = scriptContext === 'module' ? 'module' : 'instance' ;
237237
238- content = visit ( content , state ) as ESTreeAST . Program ;
238+ content = visit ( content , state ) as any ;
239239
240240 return { ...rest , content, context : scriptContext } ;
241241 } ,
@@ -265,24 +265,28 @@ export async function codemodLegacyNodes(params: Params): Promise<SvelteAST.Root
265265 if ( declaration . type === 'VariableDeclaration' ) {
266266 const { init } = declaration . declarations [ 0 ] ;
267267
268- if ( init ?. type === 'CallExpression' && init . callee . name === 'defineMeta' ) {
268+ if (
269+ init ?. type === 'CallExpression' &&
270+ 'name' in init . callee &&
271+ init . callee . name === 'defineMeta'
272+ ) {
269273 continue ;
270274 }
271275 }
272276
273277 instanceBody . push ( declaration ) ;
274278 }
275279
276- node . body = instanceBody ;
280+ node . body = instanceBody as any ;
277281 }
278282
279283 if ( state . currentScript === 'module' ) {
280284 if ( state . storiesComponentImportDeclaration ) {
281- node . body . unshift ( state . storiesComponentImportDeclaration ) ;
285+ node . body . unshift ( state . storiesComponentImportDeclaration as any ) ;
282286 }
283287
284288 if ( state . pkgImportDeclaration ) {
285- node . body . unshift ( state . pkgImportDeclaration ) ;
289+ node . body . unshift ( state . pkgImportDeclaration as any ) ;
286290 }
287291
288292 if ( state . defineMetaFromExportConstMeta ) {
0 commit comments