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

Function isTypeSubsetOfUnion

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

Source from the content-addressed store, hash-verified

69858 return source === target || target.flags & 1048576 /* TypeFlags.Union */ && isTypeSubsetOfUnion(source, target);
69859 }
69860 function isTypeSubsetOfUnion(source, target) {
69861 if (source.flags & 1048576 /* TypeFlags.Union */) {
69862 for (var _i = 0, _a = source.types; _i < _a.length; _i++) {
69863 var t = _a[_i];
69864 if (!containsType(target.types, t)) {
69865 return false;
69866 }
69867 }
69868 return true;
69869 }
69870 if (source.flags & 1024 /* TypeFlags.EnumLiteral */ && getBaseTypeOfEnumLiteralType(source) === target) {
69871 return true;
69872 }
69873 return containsType(target.types, source);
69874 }
69875 function forEachType(type, f) {
69876 return type.flags & 1048576 /* TypeFlags.Union */ ? ts.forEach(type.types, f) : f(type);
69877 }

Callers 1

isTypeSubsetOfFunction · 0.85

Calls 2

containsTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…