(
databases: Database[]
)
| 66 | // Compose then immutably merge into the by-name cache; returns the composed |
| 67 | // list so callers can hand it straight back to their consumers. |
| 68 | const upsertDatabases = async ( |
| 69 | databases: Database[] |
| 70 | ): Promise<Database[]> => { |
| 71 | const composed = await composeDatabases(databases); |
| 72 | set((state) => { |
| 73 | const next = { ...state.databasesByName }; |
| 74 | for (const db of composed) { |
| 75 | next[db.name] = db; |
| 76 | } |
| 77 | return { databasesByName: next }; |
| 78 | }); |
| 79 | return composed; |
| 80 | }; |
| 81 | |
| 82 | const fetchByName = async ( |
| 83 | name: string, |
no test coverage detected