Skip to content

Commit edca0aa

Browse files
committed
fix: add spaces between different return types of functions
1 parent 776dd0b commit edca0aa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/generators/jsx-ast/utils/buildSignature.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ export const generateSignature = (
2323
}
2424

2525
// Function or method
26-
const returnStr = returnType ? `: ${returnType.type}` : '';
26+
const returnStr = (returnType ? `: ${returnType.type}` : '')
27+
.split('|')
28+
.map(part => part.trim())
29+
.filter(Boolean)
30+
.join(' | ');
2731

2832
const paramsStr = params
2933
.map(param => {

0 commit comments

Comments
 (0)