(output: string)
| 70 | } |
| 71 | |
| 72 | export function parseSystemctlShow(output: string): Record<string, string> { |
| 73 | const result: Record<string, string> = {}; |
| 74 | for (const rawLine of output.split(/\r?\n/)) { |
| 75 | const idx = rawLine.indexOf('='); |
| 76 | if (idx === -1) continue; |
| 77 | const key = rawLine.slice(0, idx).trim(); |
| 78 | const value = rawLine.slice(idx + 1); |
| 79 | if (key.length > 0) { |
| 80 | result[key] = value; |
| 81 | } |
| 82 | } |
| 83 | return result; |
| 84 | } |
no outgoing calls
no test coverage detected