Skip to content

Commit

Permalink
Update ts codegen
Browse files Browse the repository at this point in the history
Makes the return type of `static getFullyQualifiedName()` be a string literal instead of just the string type
  • Loading branch information
rametta committed Oct 8, 2024
1 parent 2f59a03 commit dbcd606
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/idl_gen_ts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1941,11 +1941,15 @@ class TsGenerator : public BaseGenerator {

// Emit the fully qualified name
if (parser_.opts.generate_name_strings) {
const std::string fullyQualifiedName = struct_def.defined_namespace->GetFullyQualifiedName(struct_def.name);

GenDocComment(code_ptr);
code += "static getFullyQualifiedName():string {\n";
code += "static getFullyQualifiedName(): \"";
code += fullyQualifiedName;
code += "\" {\n";
code +=
" return '" +
struct_def.defined_namespace->GetFullyQualifiedName(struct_def.name) +
fullyQualifiedName +
"';\n";
code += "}\n\n";
}
Expand Down

0 comments on commit dbcd606

Please sign in to comment.