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

Function getFilesInErrorForSummary

test/fixtures/snapshot/typescript.js:122778–122797  ·  view source on GitHub ↗
(diagnostics)

Source from the content-addressed store, hash-verified

122776 }
122777 ts.getErrorCountForSummary = getErrorCountForSummary;
122778 function getFilesInErrorForSummary(diagnostics) {
122779 var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
122780 .map(function (errorDiagnostic) {
122781 if (errorDiagnostic.file === undefined)
122782 return;
122783 return "".concat(errorDiagnostic.file.fileName);
122784 });
122785 return filesInError.map(function (fileName) {
122786 var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
122787 return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
122788 });
122789 if (diagnosticForFileName !== undefined) {
122790 var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
122791 return {
122792 fileName: fileName,
122793 line: line + 1,
122794 };
122795 }
122796 });
122797 }
122798 ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
122799 function getWatchErrorSummaryDiagnosticMessage(errorCount) {
122800 return errorCount === 1 ?

Callers 1

emitFilesAndReportErrorsFunction · 0.85

Calls 4

concatMethod · 0.80
mapMethod · 0.65
filterMethod · 0.65
findMethod · 0.65

Tested by

no test coverage detected