MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / collectParams

Function collectParams

src/context/data-flow.ts:66–77  ·  view source on GitHub ↗

Collect identifier strings declared as parameters within `node`.

(node: any, source: string, into: Set<string>)

Source from the content-addressed store, hash-verified

64
65/** Collect identifier strings declared as parameters within `node`. */
66function collectParams(node: any, source: string, into: Set<string>): void {
67 const params = node.childForFieldName?.('parameters');
68 if (!params) return;
69 const walk = (n: any) => {
70 if (!n) return;
71 if (n.type === 'identifier' || n.type === 'shorthand_property_identifier_pattern') {
72 into.add(source.slice(n.startIndex, n.endIndex));
73 }
74 for (let i = 0; i < (n.childCount ?? 0); i++) walk(n.child(i));
75 };
76 walk(params);
77}
78
79/**
80 * Analyze every top-level-ish function in a file and return its free variables.

Callers 2

analyzeFunctionFunction · 0.85
gatherDeclsFunction · 0.85

Calls 1

walkFunction · 0.70

Tested by

no test coverage detected