Ensure optional arrays, arrays with defaults, and strings with defaults are supported (#8896)

Fixing issues with generated ts/js
This commit is contained in:
Abhay Agarwal
2026-02-22 23:55:37 -08:00
committed by GitHub
parent fa709636b4
commit 94d6b8086b
5 changed files with 129 additions and 31 deletions

View File

@@ -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 {