@whatwg-node/node-fetch 0.7.15-alpha-20250324173008-e214682794a80d23e60fa5a3ee070fdb4871da83 → 0.7.15-alpha-20250324173553-1c494d807956f93726a5088943b9a352670208b0

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/cjs/Body.js +3 -10
  2. package/esm/Body.js +3 -10
  3. package/package.json +1 -1
package/cjs/Body.js CHANGED
@@ -132,16 +132,9 @@ class PonyfillBody {
132
132
  this._chunks = [];
133
133
  return (0, utils_js_1.fakePromise)(this._chunks);
134
134
  }
135
- const chunks = [];
136
- _body.readable.on('data', chunk => {
137
- chunks.push(chunk);
138
- });
139
- return new Promise((resolve, reject) => {
140
- _body.readable.once('end', () => {
141
- this._chunks = chunks;
142
- resolve(this._chunks);
143
- });
144
- _body.readable.once('error', reject);
135
+ return _body.readable.toArray({ signal: this.signal }).then(chunks => {
136
+ this._chunks = chunks;
137
+ return this._chunks;
145
138
  });
146
139
  }
147
140
  _collectChunksFromReadable() {
package/esm/Body.js CHANGED
@@ -128,16 +128,9 @@ export class PonyfillBody {
128
128
  this._chunks = [];
129
129
  return fakePromise(this._chunks);
130
130
  }
131
- const chunks = [];
132
- _body.readable.on('data', chunk => {
133
- chunks.push(chunk);
134
- });
135
- return new Promise((resolve, reject) => {
136
- _body.readable.once('end', () => {
137
- this._chunks = chunks;
138
- resolve(this._chunks);
139
- });
140
- _body.readable.once('error', reject);
131
+ return _body.readable.toArray({ signal: this.signal }).then(chunks => {
132
+ this._chunks = chunks;
133
+ return this._chunks;
141
134
  });
142
135
  }
143
136
  _collectChunksFromReadable() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.7.15-alpha-20250324173008-e214682794a80d23e60fa5a3ee070fdb4871da83",
3
+ "version": "0.7.15-alpha-20250324173553-1c494d807956f93726a5088943b9a352670208b0",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "dependencies": {