Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getExitSignals = function() {
const exitSignals = signals()
return exitSignals.includes('SIGUSR2')
? exitSignals
: [...exitSignals, 'SIGUSR2']
}
function proxySignals (parent, child) {
const listeners = new Map()
for (const sig of signalExit.signals()) {
const listener = () => child.kill(sig)
listeners.set(sig, listener)
parent.on(sig, listener)
}
return function unproxySignals () {
for (const [sig, listener] of listeners) {
parent.removeListener(sig, listener)
}
}
}