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

Function isDiscriminantProperty

test/fixtures/snapshot/typescript.js:69415–69428  ·  view source on GitHub ↗
(type, name)

Source from the content-addressed store, hash-verified

69413 return false;
69414 }
69415 function isDiscriminantProperty(type, name) {
69416 if (type && type.flags & 1048576 /* TypeFlags.Union */) {
69417 var prop = getUnionOrIntersectionProperty(type, name);
69418 if (prop && ts.getCheckFlags(prop) & 2 /* CheckFlags.SyntheticProperty */) {
69419 if (prop.isDiscriminantProperty === undefined) {
69420 prop.isDiscriminantProperty =
69421 (prop.checkFlags & 192 /* CheckFlags.Discriminant */) === 192 /* CheckFlags.Discriminant */ &&
69422 !isGenericType(getTypeOfSymbol(prop));
69423 }
69424 return !!prop.isDiscriminantProperty;
69425 }
69426 }
69427 return false;
69428 }
69429 function findDiscriminantProperties(sourceProperties, target) {
69430 var result;
69431 for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) {

Calls 3

isGenericTypeFunction · 0.85
getTypeOfSymbolFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…