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

Function hasProp

test/fixtures/snapshot/typescript.js:75032–75039  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

75030 function getSuggestionForNonexistentIndexSignature(objectType, expr, keyedType) {
75031 // check if object type has setter or getter
75032 function hasProp(name) {
75033 var prop = getPropertyOfObjectType(objectType, name);
75034 if (prop) {
75035 var s = getSingleCallSignature(getTypeOfSymbol(prop));
75036 return !!s && getMinArgumentCount(s) >= 1 && isTypeAssignableTo(keyedType, getTypeAtPosition(s, 0));
75037 }
75038 return false;
75039 }
75040 ;
75041 var suggestedMethod = ts.isAssignmentTarget(expr) ? "set" : "get";
75042 if (!hasProp(suggestedMethod)) {

Calls 6

getPropertyOfObjectTypeFunction · 0.85
getSingleCallSignatureFunction · 0.85
getTypeOfSymbolFunction · 0.85
getMinArgumentCountFunction · 0.85
isTypeAssignableToFunction · 0.85
getTypeAtPositionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…