(pid: number)
| 4 | export const isWindows = (): boolean => process.platform === 'win32'; |
| 5 | |
| 6 | export function isProcessAlive(pid: number): boolean { |
| 7 | if (!Number.isFinite(pid) || pid <= 0) { |
| 8 | return false; |
| 9 | } |
| 10 | |
| 11 | try { |
| 12 | process.kill(pid, 0); |
| 13 | return true; |
| 14 | } catch { |
| 15 | return false; |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | function killProcessWindows(pid: number, force: boolean): boolean { |
| 20 | if (!isProcessAlive(pid)) { |
no outgoing calls
no test coverage detected