MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / stringifyComponentTree

Function stringifyComponentTree

packages/extension/mcp/tools/code/index.ts:593–603  ·  view source on GitHub ↗
(
  component: DevComponent | string,
  rootTag: string | undefined,
  nodeId: string,
  lang: CodeLanguage
)

Source from the content-addressed store, hash-verified

591 if (!snapshot) continue
592 snapshot.children.forEach((childId) => skipDescendants(childId, tree, pluginSkipped))
593 }
594 }
595
596 return { pluginComponents, pluginSkipped }
597}
598
599function skipDescendants(id: string, tree: VisibleTree, skipped: Set<string>): void {
600 const node = tree.nodes.get(id)
601 if (!node) return
602 if (skipped.has(id)) return
603 skipped.add(id)
604 node.children.forEach((childId) => skipDescendants(childId, tree, skipped))
605}
606

Callers 1

renderMarkupFunction · 0.85

Calls 3

stringifyComponentFunction · 0.90
normalizeRootStringFunction · 0.85
createStringifyOptionsFunction · 0.85

Tested by

no test coverage detected