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.
This commit is contained in:
Bèr Kessels 2022-02-15 17:40:57 +01:00
parent 8f35b71651
commit bc94223674

View File

@ -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')
}