env-cmd icon indicating copy to clipboard operation
env-cmd copied to clipboard

fix: returning "true" instead of "void"

Open berkes opened this issue 3 years ago • 1 comments

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.

berkes avatar Feb 15 '22 16:02 berkes

Before, this raised an error for lint, test and basically any command:

TSError: ⨯ Unable to compile TypeScript:
src/signal-termination.ts:92:7 - error TS2322: Type 'true' is not assignable to type 'void'.

92       return process.kill(process.pid, signal)

berkes avatar Feb 15 '22 16:02 berkes