like-thread 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +5 -3
  2. package/package.json +1 -1
  3. package/worker.js +1 -1
package/index.js CHANGED
@@ -102,6 +102,8 @@ module.exports = class Thread {
102
102
  }
103
103
  })
104
104
  })
105
+
106
+ this.promise.catch(noop)
105
107
  }
106
108
 
107
109
  _onMessage (msg) {
@@ -287,8 +289,8 @@ module.exports = class Thread {
287
289
  async close () {
288
290
  this.worker.postMessage({ command: 'exit' })
289
291
 
290
- await this.promise
291
-
292
- // await this.worker.terminate()
292
+ await this.promise.catch(noop)
293
293
  }
294
294
  }
295
+
296
+ function noop () {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "like-thread",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
package/worker.js CHANGED
@@ -11,7 +11,7 @@ const fn = workerData.fn.replace(entrypoint[0], (isAsync ? 'async ' : '') + 'fun
11
11
 
12
12
  parentPort.on('message', async (msg) => {
13
13
  if (msg.command === 'exit') {
14
- process.exit(0)
14
+ process.exit()
15
15
  return
16
16
  }
17
17