@whatwg-node/node-fetch 0.7.23 → 0.7.24-alpha-20250729135118-3a4a7a7ed58d4557db449f3e9ce16a8cf76c9184
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 +7 -0
- package/esm/utils.js +7 -0
- package/package.json +1 -1
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