Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function readFile(filename: string, options: NormalizedCompileOptions): string {
const { files } = options;
if (fileExists(filename, options)) {
return files[filename];
} else {
throw generateCompilerError(ModuleResolutionErrors.NONEXISTENT_FILE, {
messageArgs: [filename],
origin: { filename },
});
}
}
function readFile(filename: string, options: NormalizedCompilerOptions): string {
const { files } = options;
if (fileExists(filename, options)) {
return files[filename];
} else {
throw generateCompilerError(ModuleResolutionErrors.NONEXISTENT_FILE, {
messageArgs: [filename],
origin: { filename },
});
}
}