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

Function inferToConditionalType

test/fixtures/snapshot/typescript.js:68906–68920  ·  view source on GitHub ↗
(source, target)

Source from the content-addressed store, hash-verified

68904 return false;
68905 }
68906 function inferToConditionalType(source, target) {
68907 if (source.flags & 16777216 /* TypeFlags.Conditional */) {
68908 inferFromTypes(source.checkType, target.checkType);
68909 inferFromTypes(source.extendsType, target.extendsType);
68910 inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target));
68911 inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target));
68912 }
68913 else {
68914 var savePriority = priority;
68915 priority |= contravariant ? 64 /* InferencePriority.ContravariantConditional */ : 0;
68916 var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)];
68917 inferToMultipleTypes(source, targetTypes, target.flags);
68918 priority = savePriority;
68919 }
68920 }
68921 function inferToTemplateLiteralType(source, target) {
68922 var matches = inferTypesFromTemplateLiteralType(source, target);
68923 var types = target.types;

Callers

nothing calls this directly

Calls 4

inferFromTypesFunction · 0.85
inferToMultipleTypesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…