thread-stream 2.4.0 → 2.4.1

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.
@@ -62,7 +62,7 @@ jobs:
62
62
  run: npm run test:ci
63
63
 
64
64
  - name: Coveralls Parallel
65
- uses: coverallsapp/github-action@1.1.3
65
+ uses: coverallsapp/github-action@v2.2.3
66
66
  with:
67
67
  github-token: ${{ secrets.github_token }}
68
68
  parallel: true
@@ -73,7 +73,7 @@ jobs:
73
73
  runs-on: ubuntu-latest
74
74
  steps:
75
75
  - name: Coveralls Finished
76
- uses: coverallsapp/github-action@1.1.3
76
+ uses: coverallsapp/github-action@v2.2.3
77
77
  with:
78
78
  github-token: ${{ secrets.GITHUB_TOKEN }}
79
79
  parallel-finished: true
package/index.js CHANGED
@@ -28,13 +28,16 @@ class FakeWeakRef {
28
28
  }
29
29
  }
30
30
 
31
- const FinalizationRegistry = global.FinalizationRegistry || class FakeFinalizationRegistry {
31
+ class FakeFinalizationRegistry {
32
32
  register () {}
33
33
 
34
34
  unregister () {}
35
35
  }
36
36
 
37
- const WeakRef = global.WeakRef || FakeWeakRef
37
+ // Currently using FinalizationRegistry with code coverage breaks the world
38
+ // Ref: https://github.com/nodejs/node/issues/49344
39
+ const FinalizationRegistry = process.env.NODE_V8_COVERAGE ? FakeFinalizationRegistry : global.FinalizationRegistry || FakeFinalizationRegistry
40
+ const WeakRef = process.env.NODE_V8_COVERAGE ? FakeWeakRef : global.WeakRef || FakeWeakRef
38
41
 
39
42
  const registry = new FinalizationRegistry((worker) => {
40
43
  if (worker.exited) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thread-stream",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "A streaming way to send data to a Node.js Worker Thread",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",