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

Function narrowByInKeyword

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

Source from the content-addressed store, hash-verified

70860 return getApplicableIndexInfoForName(type, propName) ? true : !assumeTrue;
70861 }
70862 function narrowByInKeyword(type, name, assumeTrue) {
70863 if (type.flags & 1048576 /* TypeFlags.Union */
70864 || type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type
70865 || ts.isThisTypeParameter(type)
70866 || type.flags & 2097152 /* TypeFlags.Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
70867 return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
70868 }
70869 return type;
70870 }
70871 function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
70872 switch (expr.operatorToken.kind) {
70873 case 63 /* SyntaxKind.EqualsToken */:

Callers 1

Calls 3

filterTypeFunction · 0.85
isTypePresencePossibleFunction · 0.85
everyMethod · 0.80

Tested by

no test coverage detected