MCPcopy Create free account
hub / github.com/nodejs/node / typeMaybeAssignableTo

Function typeMaybeAssignableTo

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

Source from the content-addressed store, hash-verified

69547 return flow.id;
69548 }
69549 function typeMaybeAssignableTo(source, target) {
69550 if (!(source.flags & 1048576 /* TypeFlags.Union */)) {
69551 return isTypeAssignableTo(source, target);
69552 }
69553 for (var _i = 0, _a = source.types; _i < _a.length; _i++) {
69554 var t = _a[_i];
69555 if (isTypeAssignableTo(t, target)) {
69556 return true;
69557 }
69558 }
69559 return false;
69560 }
69561 // Remove those constituent types of declaredType to which no constituent type of assignedType is assignable.
69562 // For example, when a variable of type number | string | boolean is assigned a value of type number | boolean,
69563 // we remove type string.

Callers 1

getAssignmentReducedTypeFunction · 0.85

Calls 1

isTypeAssignableToFunction · 0.85

Tested by

no test coverage detected