@@ -30,7 +30,7 @@ async function copyFile(src: string, dest: string) {
3030 await fs . writeFile ( dest , convertedContent )
3131 console . log ( `Copied: ${ path . relative ( process . cwd ( ) , src ) } → ${ path . relative ( process . cwd ( ) , dest ) } ` )
3232 } catch ( error ) {
33- console . error ( `Error copying ${ src } to ${ dest } : ${ error . message } ` )
33+ console . error ( `Error copying ${ src } to ${ dest } : ${ ( error as Error ) . message } ` )
3434 throw error
3535 }
3636}
@@ -67,7 +67,7 @@ async function copyDirectory(source: string, target: string) {
6767async function createMetaJson ( directory : string ) {
6868 try {
6969 const entries = await fs . readdir ( directory )
70- const metaEntries = { }
70+ const metaEntries : Record < string , string > = { }
7171
7272 // Filter only the .mdx files (converted from .md)
7373 const mdxFiles = entries . filter ( ( entry ) => entry . endsWith ( ".mdx" ) && entry !== "index.mdx" )
@@ -85,7 +85,7 @@ async function createMetaJson(directory: string) {
8585
8686 console . log ( `Created _meta.json in ${ path . relative ( process . cwd ( ) , directory ) } ` )
8787 } catch ( error ) {
88- console . error ( `Error creating _meta.json: ${ error . message } ` )
88+ console . error ( `Error creating _meta.json: ${ ( error as Error ) . message } ` )
8989 }
9090}
9191
@@ -109,7 +109,7 @@ async function main() {
109109
110110 console . log ( "Documentation copy completed successfully!" )
111111 } catch ( error ) {
112- console . error ( "Error copying documentation:" , error . message )
112+ console . error ( "Error copying documentation:" , ( error as Error ) . message )
113113 process . exit ( 1 )
114114 }
115115}
0 commit comments