(raw: unknown)
| 55 | |
| 56 | /** The job table. Anything that is not an array of records reads as no jobs. */ |
| 57 | export function readIndexJobs(raw: unknown): IndexJob[] { |
| 58 | if (!Array.isArray(raw)) { |
| 59 | return []; |
| 60 | } |
| 61 | return raw.filter(isRecord).map((job) => ({ |
| 62 | slot: optionalNumber(job['slot']) ?? -1, |
| 63 | status: readJobStatus(job['status']), |
| 64 | path: text(job['path']), |
| 65 | error: text(job['error']), |
| 66 | })); |
| 67 | } |
| 68 | |
| 69 | export interface IndexStarted { |
| 70 | slot: number; |
no test coverage detected