refactor(desktop): organize lib modules by domain
This commit is contained in:
1 parent
90f0594e93
commit
7e7c4944e9
700 files changed
+1292
-1264
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import type { TreeNode } from "@/types/database";
|
||||
|
||||
export function findDatabaseTreeNode(nodes: TreeNode[], connectionId: string, database: string): TreeNode | null {
|
||||
for (const node of nodes) {
|
||||
if (node.type === "database" && node.connectionId === connectionId && node.database === database) {
|
||||
return node;
|
||||
}
|
||||
if (node.children) {
|
||||
const found = findDatabaseTreeNode(node.children, connectionId, database);
|
||||
if (found) return found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Reference in new issue
Block a user