( output: string, )
| 274 | } |
| 275 | |
| 276 | export function parseCounter( |
| 277 | output: string, |
| 278 | ): { current: number; total: number } | null { |
| 279 | const match = stripTerminalOutput(output).match(/\b(\d+)\/(\d+)\b/) |
| 280 | if (!match) return null |
| 281 | return { |
| 282 | current: Number.parseInt(match[1]!, 10), |
| 283 | total: Number.parseInt(match[2]!, 10), |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | export function readInkScreenCounter(ink: MountedInkProbe | undefined) { |
| 288 | if (!ink) return null |
no test coverage detected