fix for noUncheckedIndexedAccess in ts (#6474)
authorKamil Rojewski <kamil.rojewski@gmail.com>
Thu, 25 Feb 2021 22:57:10 +0000 (23:57 +0100)
committerGitHub <noreply@github.com>
Thu, 25 Feb 2021 22:57:10 +0000 (14:57 -0800)
.gitignore
src/idl_gen_ts.cpp

index 2a9f92c..8c7740a 100644 (file)
@@ -143,3 +143,4 @@ yarn-error.log
 **/dist
 **/vendor
 **/go.sum
+/tests/**/*.js
index 915b05e..2ebf1f7 100644 (file)
@@ -1460,7 +1460,7 @@ class TsGenerator : public BaseGenerator {
             code += "  for (let i = data.length - 1; i >= 0; i--) {\n";
             code += "    builder.add" + GenWriteMethod(vector_type) + "(";
             if (vector_type.base_type == BASE_TYPE_BOOL) { code += "+"; }
-            code += "data[i]);\n";
+            code += "data[i]!);\n";
             code += "  }\n";
             code += "  return builder.endVector();\n";
             code += "}\n\n";