MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / visit

Function visit

__tests__/child-process-windows-hide.test.ts:185–196  ·  view source on GitHub ↗
(node: ts.Node)

Source from the content-addressed store, hash-verified

183 const args: (ts.Expression | undefined)[] = [];
184 let usedAsValue = false;
185 const visit = (node: ts.Node): void => {
186 if (ts.isIdentifier(node) && node.text === fnName && node !== fn.name && isValueReference(node)) {
187 if (!isCallee(node)) usedAsValue = true;
188 else {
189 const call = node.parent as ts.CallExpression;
190 // A spread before the parameter's slot hides which value lands in it.
191 if (call.arguments.slice(0, index + 1).some(ts.isSpreadElement)) usedAsValue = true;
192 else args.push(call.arguments[index]);
193 }
194 }
195 ts.forEachChild(node, visit);
196 };
197 visit(sf);
198 return usedAsValue || args.length === 0 ? null : args;
199}

Callers 2

callSitesOfFunction · 0.70
scanSourceFunction · 0.70

Calls 11

isValueReferenceFunction · 0.85
isCalleeFunction · 0.85
isChildProcessModuleFunction · 0.85
spawnerOfFunction · 0.85
commandLabelFunction · 0.85
hidesWindowFunction · 0.85
optionsArgFunction · 0.85
pushMethod · 0.80
hasMethod · 0.80
flagFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected