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

Function removeLowPriorityInferences

test/fixtures/snapshot/typescript.js:157250–157263  ·  view source on GitHub ↗
(inferences, priorities)

Source from the content-addressed store, hash-verified

157248 addCandidateThisType(usage, checker.getTypeAtLocation(declaration.parent));
157249 }
157250 function removeLowPriorityInferences(inferences, priorities) {
157251 var toRemove = [];
157252 for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) {
157253 var i = inferences_1[_i];
157254 for (var _a = 0, priorities_1 = priorities; _a < priorities_1.length; _a++) {
157255 var _b = priorities_1[_a], high = _b.high, low = _b.low;
157256 if (high(i)) {
157257 ts.Debug.assert(!low(i), "Priority can't have both low and high");
157258 toRemove.push(low);
157259 }
157260 }
157261 }
157262 return inferences.filter(function (i) { return toRemove.every(function (f) { return !f(i); }); });
157263 }
157264 function combineFromUsage(usage) {
157265 return combineTypes(inferTypes(usage));
157266 }

Callers 1

combineTypesFunction · 0.85

Calls 7

highFunction · 0.85
lowFunction · 0.85
assertMethod · 0.80
everyMethod · 0.80
filterMethod · 0.65
fFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected