Skip to content

Commit 564a0f8

Browse files
committed
fix: correct typing for C String return type
1 parent 117aa37 commit 564a0f8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

metadata-generator/src/TypeScript/DefinitionWriter.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -883,11 +883,9 @@ std::string DefinitionWriter::tsifyType(const Type& type, const bool isFuncParam
883883
case TypeSelector:
884884
return "string";
885885
case TypeCString: {
886-
std::string res = "string";
887-
if (isFuncParam) {
888-
Type typeVoid(TypeVoid);
889-
res += " | " + tsifyType(::Meta::PointerType(&typeVoid), isFuncParam);
890-
}
886+
std::string res = isFuncParam ? "string | " : "";
887+
Type typeVoid(TypeVoid);
888+
res += tsifyType(::Meta::PointerType(&typeVoid), isFuncParam);
891889
return res;
892890
}
893891
case TypeProtocol:

0 commit comments

Comments
 (0)