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

Function getUndefinedStrippedTargetIfNeeded

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

Source from the content-addressed store, hash-verified

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
65374 if (source.flags & 1048576 /* TypeFlags.Union */ && target.flags & 1048576 /* TypeFlags.Union */ &&
65375 !(source.types[0].flags & 32768 /* TypeFlags.Undefined */) && target.types[0].flags & 32768 /* TypeFlags.Undefined */) {
65376 return extractTypesOfKind(target, ~32768 /* TypeFlags.Undefined */);
65377 }
65378 return target;
65379 }
65380 function eachTypeRelatedToType(source, target, reportErrors, intersectionState) {
65381 var result = -1 /* Ternary.True */;
65382 var sourceTypes = source.types;

Callers 1

eachTypeRelatedToTypeFunction · 0.85

Calls 1

extractTypesOfKindFunction · 0.85

Tested by

no test coverage detected