MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / visit

Function visit

packages/cli/src/registry/resolver.ts:158–174  ·  view source on GitHub ↗
(itemName: string, path: string[])

Source from the content-addressed store, hash-verified

156 };
157
158 const visit = async (itemName: string, path: string[]): Promise<void> => {
159 if (visited.has(itemName)) return;
160 if (visiting.has(itemName)) {
161 const cycleStart = path.indexOf(itemName);
162 const cyclePath = [...path.slice(cycleStart), itemName].join(" -> ");
163 throw new Error(`Circular registryDependencies detected: ${cyclePath}`);
164 }
165
166 visiting.add(itemName);
167 const item = await getItem(itemName);
168 for (const dep of item.registryDependencies ?? []) {
169 await visit(dep, [...path, itemName]);
170 }
171 visiting.delete(itemName);
172 visited.add(itemName);
173 ordered.push(item);
174 };
175
176 await visit(name, []);
177 return ordered;

Callers 1

Calls 3

getItemFunction · 0.85
addMethod · 0.80
deleteMethod · 0.80

Tested by

no test coverage detected