MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / createNode

Function createNode

packages/frontend/src/structure.tsx:193–213  ·  view source on GitHub ↗
(
    raw:    debug.Mapped.Owner,
    parent: Node | null,
    level:  number,
)

Source from the content-addressed store, hash-verified

191let NewNodeList: Node[]
192
193function createNode(
194 raw: debug.Mapped.Owner,
195 parent: Node | null,
196 level: number,
197): Node {
198 const {id, name, type, children: rawChildren} = raw
199
200 const children: Node[] = []
201 const node: Node = {id, type, children, parent, level}
202
203 if (name) node.name = name
204 if (type === debug.NodeType.Component && raw.hmr) node.hmr = raw.hmr
205 else if (type !== debug.NodeType.Root && raw.frozen) node.frozen = true
206
207 NewNodeList.push(node)
208
209 // map children
210 for (const child of rawChildren) children.push(createNode(child, node, level + 1))
211
212 return node
213}
214
215function updateNode(
216 node: Node,

Callers 2

updateNodeFunction · 0.85
reconcileStructureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…