MCPcopy Index your code
hub / github.com/nodejs/node / tryReadFile

Function tryReadFile

test/fixtures/snapshot/typescript.js:40813–40822  ·  view source on GitHub ↗
(fileName, readFile)

Source from the content-addressed store, hash-verified

40811 ts.readJsonConfigFile = readJsonConfigFile;
40812 /*@internal*/
40813 function tryReadFile(fileName, readFile) {
40814 var text;
40815 try {
40816 text = readFile(fileName);
40817 }
40818 catch (e) {
40819 return ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message);
40820 }
40821 return text === undefined ? ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0, fileName) : text;
40822 }
40823 ts.tryReadFile = tryReadFile;
40824 function commandLineOptionsToMap(options) {
40825 return ts.arrayToMap(options, getOptionName);

Callers 4

parseResponseFileFunction · 0.85
readConfigFileFunction · 0.85
readJsonConfigFileFunction · 0.85

Calls 1

readFileFunction · 0.70

Tested by

no test coverage detected