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

Function reclassifyByType

test/fixtures/snapshot/typescript.js:131118–131135  ·  view source on GitHub ↗
(typeChecker, node, typeIdx)

Source from the content-addressed store, hash-verified

131116 return decl && tokenFromDeclarationMapping.get(decl.kind);
131117 }
131118 function reclassifyByType(typeChecker, node, typeIdx) {
131119 // type based classifications
131120 if (typeIdx === 7 /* TokenType.variable */ || typeIdx === 9 /* TokenType.property */ || typeIdx === 6 /* TokenType.parameter */) {
131121 var type_1 = typeChecker.getTypeAtLocation(node);
131122 if (type_1) {
131123 var test = function (condition) {
131124 return condition(type_1) || type_1.isUnion() && type_1.types.some(condition);
131125 };
131126 if (typeIdx !== 6 /* TokenType.parameter */ && test(function (t) { return t.getConstructSignatures().length > 0; })) {
131127 return 0 /* TokenType.class */;
131128 }
131129 if (test(function (t) { return t.getCallSignatures().length > 0; }) && !test(function (t) { return t.getProperties().length > 0; }) || isExpressionInCallExpression(node)) {
131130 return typeIdx === 9 /* TokenType.property */ ? 11 /* TokenType.member */ : 10 /* TokenType.function */;
131131 }
131132 }
131133 }
131134 return typeIdx;
131135 }
131136 function isLocalDeclaration(decl, sourceFile) {
131137 if (ts.isBindingElement(decl)) {
131138 decl = getDeclarationForBindingElement(decl);

Callers 1

visitFunction · 0.85

Calls 3

getPropertiesMethod · 0.80
testFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…