(line: string)
| 150 | |
| 151 | /** Parses one `pi --mode json` stdout line into a {@link PiEvent}. */ |
| 152 | export function parseJsonLine(line: string): PiEvent | null { |
| 153 | const trimmed = line.trim() |
| 154 | if (!trimmed) return null |
| 155 | try { |
| 156 | return normalizePiEvent(JSON.parse(trimmed)) |
| 157 | } catch { |
| 158 | return null |
| 159 | } |
| 160 | } |
no test coverage detected