From bc942236740134c8b54f8d43ce4fe32eeeecb56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A8r=20Kessels?= Date: Tue, 15 Feb 2022 17:40:57 +0100 Subject: [PATCH] fix: returning "true" instead of "void" Apparently process.kill() returns a Boolean, so the early return will return a true||false rather than the void as per the func sig. This patch ensures we return void regardless of what process.kill() and process.exit() return. What they return may be dependent on node version and/or platform. --- src/signal-termination.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/signal-termination.ts b/src/signal-termination.ts index db8b6fc..84c2c26 100644 --- a/src/signal-termination.ts +++ b/src/signal-termination.ts @@ -89,10 +89,11 @@ export class TermSignals { */ public _terminateProcess (code?: number, signal?: NodeJS.Signals): void { if (signal !== undefined) { - return process.kill(process.pid, signal) + process.kill(process.pid, signal) + return } if (code !== undefined) { - return process.exit(code) + process.exit(code) } throw new Error('Unable to terminate parent process successfully') }