(raw: string | null | undefined)
| 16 | |
| 17 | /** Parse a PID from a pidfile body. PURE. */ |
| 18 | export function parsePid(raw: string | null | undefined): number | null { |
| 19 | const n = parseInt(String(raw ?? '').trim(), 10); |
| 20 | return Number.isInteger(n) && n > 0 ? n : null; |
| 21 | } |
| 22 | |
| 23 | /** Is a pid alive? (kill 0 probes without signalling.) */ |
| 24 | export function isAlive(pid: number): boolean { |
no outgoing calls
no test coverage detected