(raw: unknown)
| 51 | * throwing — callers treat "no rows" as absent. |
| 52 | */ |
| 53 | export function parseSourcesList(raw: unknown): GbrainSourceRow[] { |
| 54 | if (Array.isArray(raw)) return raw as GbrainSourceRow[]; |
| 55 | if (raw && typeof raw === "object" && Array.isArray((raw as { sources?: unknown }).sources)) { |
| 56 | return (raw as { sources: GbrainSourceRow[] }).sources; |
| 57 | } |
| 58 | return []; |
| 59 | } |
| 60 | |
| 61 | export interface EnsureOptions { |
| 62 | /** Pass --federated to `gbrain sources add`. Default false. */ |
no outgoing calls
no test coverage detected