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

Function getFocusedNodeData

packages/frontend/src/structure.tsx:483–498  ·  view source on GitHub ↗
(
    list: Node[],
    start: number,
    end: number,
    index: number,
)

Source from the content-addressed store, hash-verified

481}
482
483const getFocusedNodeData = (
484 list: Node[],
485 start: number,
486 end: number,
487 index: number,
488): [node: debug.NodeID, position: number] | undefined => {
489 if (index < start || index > end) index = Math.floor(end - (end - start) / 1.618)
490 let node = list[index]
491 let move = 0
492 while (node) {
493 if (node.type === debug.NodeType.Component || node.type === debug.NodeType.Root)
494 return [node.id, index - start]
495 move = move <= 0 ? -move + 1 : -move
496 node = list[(index += move)]
497 }
498}
499
500const DisplayStructureTree: s.Component = () => {
501

Callers 1

DisplayStructureTreeFunction · 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…