File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export function generateDtsTypes(sourceCode: string): string {
37
37
continue
38
38
}
39
39
40
- if ( line . trim ( ) . startsWith ( 'export' ) && ! line . includes ( '{' ) ) {
40
+ if ( line . trim ( ) . startsWith ( 'export' ) && ( line . includes ( '{' ) || line . includes ( '*' ) ) ) {
41
41
exports . push ( line )
42
42
continue
43
43
}
@@ -215,7 +215,7 @@ function preserveValueType(value: string): string {
215
215
return value // Keep string literals as is
216
216
}
217
217
else {
218
- return 'any ' // Default to any for other cases
218
+ return 'string ' // Default to string for other cases
219
219
}
220
220
}
221
221
@@ -224,5 +224,7 @@ function cleanOutput(output: string): string {
224
224
. replace ( / \{ \s * \} / g, '{}' ) // Replace empty objects with {}
225
225
. replace ( / \s * ; \s * (? = \} | $ ) / g, ';' ) // Clean up semicolons before closing braces or end of string
226
226
. replace ( / \n + / g, '\n' ) // Remove multiple consecutive newlines
227
+ . replace ( / ; \n \} / g, ';\n }' ) // Add indentation to closing brace of object literals
228
+ . replace ( / \{ ; / g, '{' ) // Remove unnecessary semicolons after opening braces
227
229
. trim ( )
228
230
}
You can’t perform that action at this time.
0 commit comments