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

Function isInCryptoKeyBranch

tools/eslint-rules/no-cryptokey-public-accessors.js:151–165  ·  view source on GitHub ↗
(name, node)

Source from the content-addressed store, hash-verified

149 }
150
151 function isInCryptoKeyBranch(name, node) {
152 for (let current = node.parent; current; current = current.parent) {
153 if (current.type !== 'IfStatement') continue;
154 if (isNodeWithin(node, current.consequent) &&
155 getConsequentCryptoKeys(current.test).has(name)) {
156 return true;
157 }
158 if (current.alternate &&
159 isNodeWithin(node, current.alternate) &&
160 getAlternateCryptoKeys(current.test).has(name)) {
161 return true;
162 }
163 }
164 return false;
165 }
166
167 function followsExitingCryptoKeyGuard(name, node) {
168 const location = findStatementInBlock(node);

Callers 1

isKnownCryptoKeyFunction · 0.85

Calls 4

getConsequentCryptoKeysFunction · 0.85
getAlternateCryptoKeysFunction · 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…