fix(idl_gen_ts): bool to number conversion in mutable API (#8677)

Co-authored-by: Björn Harrtell <bjornharrtell@users.noreply.github.com>
This commit is contained in:
nurbo
2025-09-11 17:36:15 +02:00
committed by GitHub
parent 3c0511fa6a
commit 48eccb83db

View File

@@ -1903,12 +1903,13 @@ class TsGenerator : public BaseGenerator {
code += " return false;\n";
code += " }\n\n";
// special case for bools, which are treated as uint8
code +=
" " + GenBBAccess() + write_method + "(this.bb_pos + offset, ";
if (field.value.type.base_type == BASE_TYPE_BOOL) { code += "+"; }
}
// special case for bools, which are treated as uint8
if (field.value.type.base_type == BASE_TYPE_BOOL) { code += "+"; }
code += "value);\n";
code += " return true;\n";
code += "}\n\n";