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

Function convertToReusableDiagnostics

test/fixtures/snapshot/typescript.js:120704–120720  ·  view source on GitHub ↗
(diagnostics, relativeToBuildInfo)

Source from the content-addressed store, hash-verified

120702 return value;
120703 }
120704 function convertToReusableDiagnostics(diagnostics, relativeToBuildInfo) {
120705 ts.Debug.assert(!!diagnostics.length);
120706 return diagnostics.map(function (diagnostic) {
120707 var result = convertToReusableDiagnosticRelatedInformation(diagnostic, relativeToBuildInfo);
120708 result.reportsUnnecessary = diagnostic.reportsUnnecessary;
120709 result.reportDeprecated = diagnostic.reportsDeprecated;
120710 result.source = diagnostic.source;
120711 result.skippedOn = diagnostic.skippedOn;
120712 var relatedInformation = diagnostic.relatedInformation;
120713 result.relatedInformation = relatedInformation ?
120714 relatedInformation.length ?
120715 relatedInformation.map(function (r) { return convertToReusableDiagnosticRelatedInformation(r, relativeToBuildInfo); }) :
120716 [] :
120717 undefined;
120718 return result;
120719 });
120720 }
120721 function convertToReusableDiagnosticRelatedInformation(diagnostic, relativeToBuildInfo) {
120722 var file = diagnostic.file;
120723 return __assign(__assign({}, diagnostic), { file: file ? relativeToBuildInfo(file.resolvedPath) : undefined });

Callers 1

getProgramBuildInfoFunction · 0.85

Calls 3

assertMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…