@whatwg-node/node-fetch 0.7.23 → 0.7.24-alpha-20250729134733-70408522afe09626a54f8c0311a973a2e8c3f630

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.
package/cjs/utils.js CHANGED
@@ -63,6 +63,13 @@ function pipeThrough({ src, dest, signal, onError, }) {
63
63
  // so only the writable destination needs to be destroyed
64
64
  dest.destroy(e);
65
65
  });
66
+ dest.once('close', () => {
67
+ // if the writable destination (dest) is closed, the readable stream (src)
68
+ // is not closed automatically. that needs to be done manually
69
+ if (!src.destroyed) {
70
+ src.destroy();
71
+ }
72
+ });
66
73
  if (signal) {
67
74
  // this is faster than `import('node:signal').addAbortSignal(signal, src)`
68
75
  const srcRef = new WeakRef(src);
package/esm/utils.js CHANGED
@@ -50,6 +50,13 @@ export function pipeThrough({ src, dest, signal, onError, }) {
50
50
  // so only the writable destination needs to be destroyed
51
51
  dest.destroy(e);
52
52
  });
53
+ dest.once('close', () => {
54
+ // if the writable destination (dest) is closed, the readable stream (src)
55
+ // is not closed automatically. that needs to be done manually
56
+ if (!src.destroyed) {
57
+ src.destroy();
58
+ }
59
+ });
53
60
  if (signal) {
54
61
  // this is faster than `import('node:signal').addAbortSignal(signal, src)`
55
62
  const srcRef = new WeakRef(src);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.7.23",
3
+ "version": "0.7.24-alpha-20250729134733-70408522afe09626a54f8c0311a973a2e8c3f630",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "dependencies": {