MCPcopy Create free account
hub / github.com/nodejs/node / isValidPropertyAccessWithType

Function isValidPropertyAccessWithType

test/fixtures/snapshot/typescript.js:75143–75150  ·  view source on GitHub ↗
(node, isSuper, propertyName, type)

Source from the content-addressed store, hash-verified

75141 // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context.
75142 }
75143 function isValidPropertyAccessWithType(node, isSuper, propertyName, type) {
75144 // Short-circuiting for improved performance.
75145 if (isTypeAny(type)) {
75146 return true;
75147 }
75148 var prop = getPropertyOfType(type, propertyName);
75149 return !!prop && isPropertyAccessible(node, isSuper, /* isWrite */ false, type, prop);
75150 }
75151 /**
75152 * Checks if a property can be accessed in a location.
75153 * The location is given by the `node` parameter.

Callers 1

isValidPropertyAccessFunction · 0.85

Calls 3

isTypeAnyFunction · 0.85
getPropertyOfTypeFunction · 0.85
isPropertyAccessibleFunction · 0.85

Tested by

no test coverage detected