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

Function someTypeRelatedToType

test/fixtures/snapshot/typescript.js:65357–65370  ·  view source on GitHub ↗
(source, target, reportErrors, intersectionState)

Source from the content-addressed store, hash-verified

65355 return result;
65356 }
65357 function someTypeRelatedToType(source, target, reportErrors, intersectionState) {
65358 var sourceTypes = source.types;
65359 if (source.flags & 1048576 /* TypeFlags.Union */ && containsType(sourceTypes, target)) {
65360 return -1 /* Ternary.True */;
65361 }
65362 var len = sourceTypes.length;
65363 for (var i = 0; i < len; i++) {
65364 var related = isRelatedTo(sourceTypes[i], target, 1 /* RecursionFlags.Source */, reportErrors && i === len - 1, /*headMessage*/ undefined, intersectionState);
65365 if (related) {
65366 return related;
65367 }
65368 }
65369 return 0 /* Ternary.False */;
65370 }
65371 function getUndefinedStrippedTargetIfNeeded(source, target) {
65372 // As a builtin type, `undefined` is a very low type ID - making it almsot always first, making this a very fast check to see
65373 // if we need to strip `undefined` from the target

Callers 1

Calls 2

containsTypeFunction · 0.85
isRelatedToFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…