| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f0409be commit a29adef
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,13 +46,7 @@ const noop = () => {}; | |||
| 46 | 46 | ||
| 47 | 47 | const hasCrypto = Boolean(process.versions.openssl); | |
| 48 | 48 | ||
| 49 | - const isMainThread = (() => { | ||
| 50 | - if (require('module').builtinModules.includes('worker_threads')) { | ||
| 51 | - return require('worker_threads').isMainThread; | ||
| 52 | - } | ||
| 53 | - // Worker module not enabled → only a single main thread exists. | ||
| 54 | - return true; | ||
| 55 | - })(); | ||
| 49 | + const { isMainThread } = require('worker_threads'); | ||
| 56 | 50 | ||
| 57 | 51 | // Check for flags. Skip this for workers (both, the `cluster` module and | |
| 58 | 52 | // `worker_threads`) and child processes. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments