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

Function findDiscriminantProperties

test/fixtures/snapshot/typescript.js:69429–69442  ·  view source on GitHub ↗
(sourceProperties, target)

Source from the content-addressed store, hash-verified

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++) {
69432 var sourceProperty = sourceProperties_2[_i];
69433 if (isDiscriminantProperty(target, sourceProperty.escapedName)) {
69434 if (result) {
69435 result.push(sourceProperty);
69436 continue;
69437 }
69438 result = [sourceProperty];
69439 }
69440 }
69441 return result;
69442 }
69443 // Given a set of constituent types and a property name, create and return a map keyed by the literal
69444 // types of the property by that name in each constituent type. No map is returned if some key property
69445 // has a non-literal type or if less than 10 or less than 50% of the constituents have a unique key.

Callers 2

Calls 2

isDiscriminantPropertyFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected