( path: string, id: string, )
| 175 | } |
| 176 | |
| 177 | async function readOneIssue( |
| 178 | path: string, |
| 179 | id: string, |
| 180 | ): Promise<{ ok: true; issue: IssueRecord } | { ok: false; error: string }> { |
| 181 | let raw: string |
| 182 | try { |
| 183 | const info = await stat(path) |
| 184 | if (info.size > MAX_BYTES) return { ok: false, error: `issue file too large (${info.size} bytes)` } |
| 185 | raw = await readFile(path, 'utf8') |
| 186 | } catch (err) { |
| 187 | return { ok: false, error: err instanceof Error ? err.message : String(err) } |
| 188 | } |
| 189 | |
| 190 | return parseIssueContent(id, raw) |
| 191 | } |
| 192 | |
| 193 | /** |
| 194 | * Pure parse of one issue's file content (frontmatter + body) into a validated |
no test coverage detected