Undoes one bit, adds null type allowance to addField<> default.

This commit is contained in:
Johnny Viel
2023-03-09 16:53:41 -05:00
parent 537c42a821
commit f8f93e3d30
2 changed files with 9 additions and 10 deletions

View File

@@ -1975,8 +1975,7 @@ class TsGenerator : public BaseGenerator {
GenDocComment(code_ptr);
code += "static " + namer_.Method("add", field);
code += "(builder:flatbuffers.Builder, " + argname + ":" +
GetArgType(imports, struct_def, field, /* allow null */ true) +
") {\n";
GetArgType(imports, struct_def, field, false) + ") {\n";
code += " builder.addField" + GenWriteMethod(field.value.type) + "(";
code += NumToString(it - struct_def.fields.vec.begin()) + ", ";
if (field.value.type.base_type == BASE_TYPE_BOOL) { code += "+"; }