MCPcopy Create free account
hub / github.com/MigoXLab/coderio / extractAllComponentGroups

Function extractAllComponentGroups

examples/skill-demo/scripts/coderio-skill.mjs:24–38  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

22});
23
24function extractAllComponentGroups(node) {
25 const groups = new Map();
26 function traverse(currentNode) {
27 const localGroups = extractComponentGroups(currentNode);
28 for (const [name, list] of localGroups) {
29 if (!groups.has(name)) groups.set(name, []);
30 groups.get(name).push(...list);
31 }
32 if (currentNode.children) {
33 currentNode.children.forEach(traverse);
34 }
35 }
36 traverse(node);
37 return groups;
38}
39
40function findParentOfGroup(root, componentName) {
41 let result = null;

Callers 1

mainFunction · 0.70

Calls 1

traverseFunction · 0.70

Tested by

no test coverage detected