MCPcopy
hub / github.com/marimo-team/marimo / find

Method find

frontend/src/utils/id-tree.tsx:535–551  ·  view source on GitHub ↗

* Find a node, returning the path to it * With the last element being the node itself

(id: T)

Source from the content-addressed store, hash-verified

533 * With the last element being the node itself
534 */
535 find(id: T): T[] {
536 // We need to recursively find the node
537 function findNode(nodes: TreeNode<T>[], path: T[]): T[] {
538 for (const node of nodes) {
539 if (node.value === id) {
540 return [...path, id];
541 }
542 const result = findNode(node.children, [...path, node.value]);
543 if (result.length > 0) {
544 return result;
545 }
546 }
547 return [];
548 }
549
550 return findNode(this.nodes, []);
551 }
552
553 /**
554 * Split the tree into two trees

Callers 15

findAndExpandDeepMethod · 0.95
chat-panel.tsxFile · 0.45
model-selector.tsxFile · 0.45
agent-panel.tsxFile · 0.45
state.tsFile · 0.45
getMetaFunction · 0.45
labelForDownloadFormatFunction · 0.45
labelForCopyFormatFunction · 0.45
atoms.tsFile · 0.45
createMockTableFunction · 0.45
createMockTableFunction · 0.45

Calls

no outgoing calls

Tested by 8

createMockTableFunction · 0.36
createMockTableFunction · 0.36
getColumnOptionFunction · 0.36
handleSortFunction · 0.36
findActionFunction · 0.36
findSchemaFunction · 0.36
findStyleFunction · 0.36
getCompletionFunction · 0.36