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

Function isMatchingConstructorReference

test/fixtures/snapshot/typescript.js:71196–71200  ·  view source on GitHub ↗
(expr)

Source from the content-addressed store, hash-verified

71194 return getTypeWithFacts(mapType(type, narrowUnionMemberByTypeof(impliedType)), switchFacts);
71195 }
71196 function isMatchingConstructorReference(expr) {
71197 return (ts.isPropertyAccessExpression(expr) && ts.idText(expr.name) === "constructor" ||
71198 ts.isElementAccessExpression(expr) && ts.isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor") &&
71199 isMatchingReference(reference, expr.expression);
71200 }
71201 function narrowTypeByConstructor(type, operator, identifier, assumeTrue) {
71202 // Do not narrow when checking inequality.
71203 if (assumeTrue ? (operator !== 34 /* SyntaxKind.EqualsEqualsToken */ && operator !== 36 /* SyntaxKind.EqualsEqualsEqualsToken */) : (operator !== 35 /* SyntaxKind.ExclamationEqualsToken */ && operator !== 37 /* SyntaxKind.ExclamationEqualsEqualsToken */)) {

Callers 1

Calls 1

isMatchingReferenceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…