MCPcopy Create free account
hub / github.com/experdot/pointer / buildPathToNode

Function buildPathToNode

src/renderer/src/stores/messagesStore.ts:270–276  ·  view source on GitHub ↗
(nodeId: string)

Source from the content-addressed store, hash-verified

268
269 // 递归构建路径到节点的函数
270 const buildPathToNode = (nodeId: string): string[] => {
271 const node = updatedMessages.find((msg) => msg.id === nodeId)
272 if (!node) return []
273 if (!node.parentId) return [nodeId]
274 const parentPath = buildPathToNode(node.parentId)
275 return [...parentPath, nodeId]
276 }
277
278 // 递归向下找到最新子节点的函数
279 const extendPathToLeaf = (path: string[]): string[] => {

Callers 1

messagesStore.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected