Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
watcher.on("all", (event, file) => {
// don't trigger write events for generated file changes
if (file.indexOf("__generated__") > -1) return;
// don't trigger write events on single output file
if (file.indexOf(output) > -1) return;
this.project.fileDidChange(URI.file(file).toString());
console.log("\nChange detected, generating types...");
try {
const fileCount = write();
console.log(`${chalk.green("✔")} Wrote ${fileCount} files`);
} catch (e) {
Debug.error("Error while generating types: " + e.message);
}
});
if (tty.isatty((process.stdin as any).fd)) {