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

Function unionObjectAndArrayLiteralCandidates

test/fixtures/snapshot/typescript.js:69115–69124  ·  view source on GitHub ↗
(candidates)

Source from the content-addressed store, hash-verified

69113 return !!(ts.getObjectFlags(type) & (128 /* ObjectFlags.ObjectLiteral */ | 16384 /* ObjectFlags.ArrayLiteral */));
69114 }
69115 function unionObjectAndArrayLiteralCandidates(candidates) {
69116 if (candidates.length > 1) {
69117 var objectLiterals = ts.filter(candidates, isObjectOrArrayLiteralType);
69118 if (objectLiterals.length) {
69119 var literalsType = getUnionType(objectLiterals, 2 /* UnionReduction.Subtype */);
69120 return ts.concatenate(ts.filter(candidates, function (t) { return !isObjectOrArrayLiteralType(t); }), [literalsType]);
69121 }
69122 }
69123 return candidates;
69124 }
69125 function getContravariantInference(inference) {
69126 return inference.priority & 416 /* InferencePriority.PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
69127 }

Callers 1

getCovariantInferenceFunction · 0.85

Calls 3

getUnionTypeFunction · 0.85
filterMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…