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

Function isInKeyObjectBranch

tools/eslint-rules/no-keyobject-public-accessors.js:164–178  ·  view source on GitHub ↗
(name, node)

Source from the content-addressed store, hash-verified

162 }
163
164 function isInKeyObjectBranch(name, node) {
165 for (let current = node.parent; current; current = current.parent) {
166 if (current.type !== 'IfStatement') continue;
167 if (isNodeWithin(node, current.consequent) &&
168 getConsequentKeyObjects(current.test).has(name)) {
169 return true;
170 }
171 if (current.alternate &&
172 isNodeWithin(node, current.alternate) &&
173 getAlternateKeyObjects(current.test).has(name)) {
174 return true;
175 }
176 }
177 return false;
178 }
179
180 function followsExitingKeyObjectGuard(name, node) {
181 const location = findStatementInBlock(node);

Callers 1

isKnownKeyObjectFunction · 0.85

Calls 4

getConsequentKeyObjectsFunction · 0.85
getAlternateKeyObjectsFunction · 0.85
isNodeWithinFunction · 0.70
hasMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…