mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-11 15:37:27 +00:00
Ensure optional arrays, arrays with defaults, and strings with defaults are supported (#8896)
Fixing issues with generated ts/js
This commit is contained in:
@@ -87,6 +87,20 @@ flatc(
|
||||
)
|
||||
esbuild("monster_test.ts", "monster_test_generated.cjs")
|
||||
|
||||
flatc(
|
||||
options=[
|
||||
"--ts",
|
||||
"--reflect-names",
|
||||
"--gen-name-strings",
|
||||
"--gen-mutable",
|
||||
"--gen-object-api",
|
||||
"--ts-entry-points",
|
||||
"--ts-flat-files",
|
||||
],
|
||||
schema="../even_more_defaults.fbs",
|
||||
include="../include_test",
|
||||
)
|
||||
|
||||
flatc(
|
||||
options=["--gen-object-api", "-b"],
|
||||
schema="../monster_test.fbs",
|
||||
|
||||
@@ -81,11 +81,11 @@ mutate_hp(value:number):boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
name():string|null
|
||||
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
name(optionalEncoding?:any):string|Uint8Array|null {
|
||||
name():string
|
||||
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array
|
||||
name(optionalEncoding?:any):string|Uint8Array {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
return this.bb!.__string(this.bb_pos + offset, optionalEncoding);
|
||||
}
|
||||
|
||||
inventory(index: number):number|null {
|
||||
|
||||
Reference in New Issue
Block a user