mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-23 12:20:00 +00:00
[JS] Add getFullyQualifiedName() (#6119)
This optionally generates a static `getFullyQualifiedName()` function to get the fully-qualified name of a type in JavaScript and TypeScript in a similar fashion to the C++ codegen.
This commit is contained in:
@@ -80,6 +80,13 @@ fooStruct(obj?:NS8755221360535654258.NamespaceA.NamespaceB.StructInNestedNS):NS8
|
||||
return offset ? (obj || new NS8755221360535654258.NamespaceA.NamespaceB.StructInNestedNS()).__init(this.bb_pos + offset, this.bb!) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns string
|
||||
*/
|
||||
static getFullyQualifiedName():string {
|
||||
return 'NamespaceA.TableInFirstNS';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param flatbuffers.Builder builder
|
||||
*/
|
||||
@@ -225,6 +232,13 @@ referToA2(obj?:NamespaceA.SecondTableInA):NamespaceA.SecondTableInA|null {
|
||||
return offset ? (obj || new NamespaceA.SecondTableInA()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns string
|
||||
*/
|
||||
static getFullyQualifiedName():string {
|
||||
return 'NamespaceC.TableInC';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param flatbuffers.Builder builder
|
||||
*/
|
||||
@@ -348,6 +362,13 @@ referToC(obj?:NamespaceC.TableInC):NamespaceC.TableInC|null {
|
||||
return offset ? (obj || new NamespaceC.TableInC()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns string
|
||||
*/
|
||||
static getFullyQualifiedName():string {
|
||||
return 'NamespaceA.SecondTableInA';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param flatbuffers.Builder builder
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user