Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
generatedFiles.map(o => o.content().fileContents).join("\n") +
"\n" +
generatedGlobalFile.fileContents
);
writtenFiles += 1;
}
} else {
let output;
const context = compileToLegacyIR(schema, document, options);
switch (target) {
case "json":
output = serializeToJSON(context);
break;
case "scala":
output = generateScalaSource(context);
}
if (outputPath) {
fs.writeFileSync(outputPath, output);
writtenFiles += 1;
} else {
console.log(output);
}
}
return writtenFiles;
}