MCPcopy Create free account
hub / github.com/ehmicky/log-process-errors / shouldExit

Function shouldExit

src/exit.js:24–34  ·  view source on GitHub ↗
(exit, event)

Source from the content-addressed store, hash-verified

22}
23
24const shouldExit = (exit, event) => {
25 if (!isExitEvent(event)) {
26 return false
27 }
28
29 if (exit !== undefined) {
30 return exit
31 }
32
33 return process.listeners(event).length <= 1
34}
35
36const isExitEvent = (event) =>
37 event === 'uncaughtException' || event === 'unhandledRejection'

Callers 1

exitProcessFunction · 0.85

Calls 1

isExitEventFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…