Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: hide relaySignal from process.listeners() (#194)
  • Loading branch information
jakzo committed Mar 12, 2023
1 parent 7a35586 commit b6793b2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/preflight.cts
Expand Up @@ -45,4 +45,14 @@ if (process.send) {
}
return count;
};

// Also hide relaySignal from process.listeners()
const { listeners } = process;
process.listeners = function (eventName) {

Check warning on line 51 in src/preflight.cts

GitHub Actions / Release

Unexpected unnamed function

Check warning on line 51 in src/preflight.cts

GitHub Actions / Test (ubuntu-latest)

Unexpected unnamed function
const result = Reflect.apply(listeners, this, arguments);
if (relaySignals.includes(eventName as any)) {

Check warning on line 53 in src/preflight.cts

GitHub Actions / Release

Unexpected any. Specify a different type

Check warning on line 53 in src/preflight.cts

GitHub Actions / Test (ubuntu-latest)

Unexpected any. Specify a different type
return result.filter((listener: any) => listener !== relaySignal);
}
return result;
};
}

0 comments on commit b6793b2

Please sign in to comment.