Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (outputIndividualFiles) {
writeGeneratedFiles(generator.generatedFiles, outputPath, "\n");
writtenFiles += Object.keys(generator.generatedFiles).length;
} else {
fs.writeFileSync(outputPath, generator.output.concat("\n"));
writtenFiles += 1;
}
if (options.generateOperationIds) {
writeOperationIdsMap(context);
writtenFiles += 1;
}
} else if (target === "flow") {
const context = compileToIR(schema, document, options);
const { generatedFiles, common } = generateFlowSource(context);
const outFiles: {
[fileName: string]: BasicGeneratedFile;
} = {};
if (nextToSources) {
generatedFiles.forEach(({ sourcePath, fileName, content }) => {
const dir = path.join(
path.dirname(path.posix.relative(rootPath, toPath(sourcePath))),
outputPath
);
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
outFiles[path.join(dir, fileName)] = {