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

Function eachUnionContains

test/fixtures/snapshot/typescript.js:61488–61503  ·  view source on GitHub ↗
(unionTypes, type)

Source from the content-addressed store, hash-verified

61486 // an identical type, and a literal type is additionally matched by its corresponding
61487 // primitive type.
61488 function eachUnionContains(unionTypes, type) {
61489 for (var _i = 0, unionTypes_1 = unionTypes; _i < unionTypes_1.length; _i++) {
61490 var u = unionTypes_1[_i];
61491 if (!containsType(u.types, type)) {
61492 var primitive = type.flags & 128 /* TypeFlags.StringLiteral */ ? stringType :
61493 type.flags & 256 /* TypeFlags.NumberLiteral */ ? numberType :
61494 type.flags & 2048 /* TypeFlags.BigIntLiteral */ ? bigintType :
61495 type.flags & 8192 /* TypeFlags.UniqueESSymbol */ ? esSymbolType :
61496 undefined;
61497 if (!primitive || !containsType(u.types, primitive)) {
61498 return false;
61499 }
61500 }
61501 }
61502 return true;
61503 }
61504 /**
61505 * Returns `true` if the intersection of the template literals and string literals is the empty set, eg `get${string}` & "setX", and should reduce to `never`
61506 */

Callers 1

Calls 1

containsTypeFunction · 0.85

Tested by

no test coverage detected