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

Function getSupertypeOrUnion

test/fixtures/snapshot/typescript.js:67381–67388  ·  view source on GitHub ↗
(types)

Source from the content-addressed store, hash-verified

67379 // of those literal types. Otherwise, return the leftmost type for which no type to the
67380 // right is a supertype.
67381 function getSupertypeOrUnion(types) {
67382 if (types.length === 1) {
67383 return types[0];
67384 }
67385 return literalTypesWithSameBaseType(types) ?
67386 getUnionType(types) :
67387 ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(s, t) ? t : s; });
67388 }
67389 function getCommonSupertype(types) {
67390 if (!strictNullChecks) {
67391 return getSupertypeOrUnion(types);

Callers 1

getCommonSupertypeFunction · 0.85

Calls 3

getUnionTypeFunction · 0.85
isTypeSubtypeOfFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…