Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fs.stat(data[0], (error) => {
if (error) {
message(requireValidationMessages.inValidTemplateMsg);
return reject({
file: false
});
} else if (!isTextPath(data[0])) {
//Check for text file
message(`Not a valid template file. Please
provide a plain text file format in
the first command input.`);
return resolve({
file: false
});
} else {
return resolve({
file: true
});
}
});
}),