( sourceConfigs: SourceConfig[], getToolsForSource: (sourceId: string) => string[], isDemo: boolean )
| 175 | * Build SourceDisplayInfo from source configs and tool names |
| 176 | */ |
| 177 | export function buildSourceDisplayInfo( |
| 178 | sourceConfigs: SourceConfig[], |
| 179 | getToolsForSource: (sourceId: string) => string[], |
| 180 | isDemo: boolean |
| 181 | ): SourceDisplayInfo[] { |
| 182 | return sourceConfigs.map((source) => { |
| 183 | const { host, database } = parseHostAndDatabase(source); |
| 184 | |
| 185 | return { |
| 186 | id: source.id, |
| 187 | type: source.type || "sqlite", |
| 188 | host, |
| 189 | database, |
| 190 | readonly: source.readonly || false, |
| 191 | isDemo, |
| 192 | tools: getToolsForSource(source.id), |
| 193 | }; |
| 194 | }); |
| 195 | } |
no test coverage detected