Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseFileSync(filePath) {
// Read
const data = fs.readFileSync(filePath)
// Check the result
if (typeChecker.isError(data)) {
// An error occured
return data
} else {
// Parse the result
return parseSync(data.toString())
}
}