diff --git a/tools/js-class-c-struct-transpiler/transpile.js b/tools/js-class-c-struct-transpiler/transpile.js index 0153c42..cced04d 100644 --- a/tools/js-class-c-struct-transpiler/transpile.js +++ b/tools/js-class-c-struct-transpiler/transpile.js @@ -178,8 +178,8 @@ for (const type of Object.keys(schema)) { const foreignKey = `${propType.toLowerCase()}_id`; const localKey = `${prop.toLowerCase()}_${foreignKey}`; - sqlData += `,${localKey} INTEGER`; - foreignKeys += `\nFOREIGN KEY(${localKey}) REFERENCES ${propType}(${foreignKey})` + sqlData += `, ${localKey} INTEGER`; + foreignKeys += `\n, FOREIGN KEY(${localKey}) REFERENCES ${propType}(${foreignKey})` cData += `\n\t\t${types[propType].c} ${prop};`; break; case "array": @@ -205,7 +205,7 @@ for (const type of Object.keys(schema)) { jsData += jsStructConstructor(size, containsString); jsData += `\n}\n\nexport default ${type}`; cData += `\n} ${type};\n\n`; - sqlData += `)${foreignKeys};\n\n`; + sqlData += `${foreignKeys});\n\n`; await Bun.write( Bun.file(values.javascript_out + type + ".js"),