MCPcopy Create free account
hub / github.com/nodejs/node / getMergedBindAndCheckDiagnostics

Function getMergedBindAndCheckDiagnostics

test/fixtures/snapshot/typescript.js:117648–117664  ·  view source on GitHub ↗
(sourceFile, includeBindAndCheckDiagnostics)

Source from the content-addressed store, hash-verified

117646 });
117647 }
117648 function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics) {
117649 var _a;
117650 var allDiagnostics = [];
117651 for (var _i = 2; _i < arguments.length; _i++) {
117652 allDiagnostics[_i - 2] = arguments[_i];
117653 }
117654 var flatDiagnostics = ts.flatten(allDiagnostics);
117655 if (!includeBindAndCheckDiagnostics || !((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) {
117656 return flatDiagnostics;
117657 }
117658 var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives;
117659 for (var _c = 0, _d = directives.getUnusedExpectations(); _c < _d.length; _c++) {
117660 var errorExpectation = _d[_c];
117661 diagnostics.push(ts.createDiagnosticForRange(sourceFile, errorExpectation.range, ts.Diagnostics.Unused_ts_expect_error_directive));
117662 }
117663 return diagnostics;
117664 }
117665 /**
117666 * Creates a map of comment directives along with the diagnostics immediately preceded by one of them.
117667 * Comments that match to any of those diagnostics are marked as used.

Calls 2

pushMethod · 0.45

Tested by

no test coverage detected