mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
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:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user