Update ts codegen (#8421)

Makes the return type of `static getFullyQualifiedName()` be a string literal instead of just the string type

Update tests

Co-authored-by: Björn Harrtell <bjornharrtell@users.noreply.github.com>
This commit is contained in:
Jason
2025-08-17 23:19:08 -04:00
committed by GitHub
parent 5218e29aa4
commit 067bfdbde9
20 changed files with 25 additions and 21 deletions

View File

@@ -1944,11 +1944,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";
}