toddbluhm / env-cmd

Setting environment variables from a file
https://www.npmjs.com/package/env-cmd
MIT License
1.73k stars 65 forks source link

fix: returning "true" instead of "void" #346

Open berkes opened 2 years ago

berkes commented 2 years ago

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 commented 2 years ago

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)