@whatwg-node/node-fetch 0.7.23-alpha-20250726021628-c861bb0cd6c3ada6f0e3083708b8efbc457229ab → 0.7.23-alpha-20250726021906-27dea3e7c5dae7285bf9c837cce54f387e269df2

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 +0 -24
  2. package/esm/Body.js +1 -25
  3. package/package.json +1 -1
package/cjs/Body.js CHANGED
@@ -36,36 +36,12 @@ class PonyfillBody {
36
36
  this.contentLength = contentLength;
37
37
  this.bodyType = bodyType;
38
38
  this._buffer = buffer;
39
- if (!buffer) {
40
- this._chunks = this._doCollectChunksFromReadableJob();
41
- }
42
39
  }
43
40
  bodyType;
44
41
  _bodyFactory = () => null;
45
42
  _generatedBody = null;
46
43
  _buffer;
47
44
  generateBody() {
48
- if (!this._buffer && this._chunks) {
49
- if ((0, promise_helpers_1.isPromise)(this._chunks)) {
50
- const chunks$ = this._chunks;
51
- this._generatedBody = new ReadableStream_js_1.PonyfillReadableStream({
52
- start: controller => {
53
- chunks$.then(chunks => {
54
- this._buffer = node_buffer_1.Buffer.concat(chunks);
55
- for (const chunk of chunks) {
56
- controller.enqueue(chunk);
57
- }
58
- controller.close();
59
- });
60
- },
61
- });
62
- }
63
- else {
64
- this._buffer = node_buffer_1.Buffer.concat(this._chunks);
65
- this._generatedBody = new ReadableStream_js_1.PonyfillReadableStream(node_stream_1.Readable.from(this._buffer));
66
- }
67
- return this._generatedBody;
68
- }
69
45
  if (this._generatedBody?.readable?.destroyed && this._buffer) {
70
46
  this._generatedBody.readable = node_stream_1.Readable.from(this._buffer);
71
47
  }
package/esm/Body.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { Buffer } from 'node:buffer';
3
3
  import { Readable } from 'node:stream';
4
4
  import { Busboy } from '@fastify/busboy';
5
- import { handleMaybePromise, isPromise } from '@whatwg-node/promise-helpers';
5
+ import { handleMaybePromise } from '@whatwg-node/promise-helpers';
6
6
  import { hasArrayBufferMethod, hasBufferMethod, hasBytesMethod, PonyfillBlob } from './Blob.js';
7
7
  import { PonyfillFile } from './File.js';
8
8
  import { getStreamFromFormData, PonyfillFormData } from './FormData.js';
@@ -33,36 +33,12 @@ export class PonyfillBody {
33
33
  this.contentLength = contentLength;
34
34
  this.bodyType = bodyType;
35
35
  this._buffer = buffer;
36
- if (!buffer) {
37
- this._chunks = this._doCollectChunksFromReadableJob();
38
- }
39
36
  }
40
37
  bodyType;
41
38
  _bodyFactory = () => null;
42
39
  _generatedBody = null;
43
40
  _buffer;
44
41
  generateBody() {
45
- if (!this._buffer && this._chunks) {
46
- if (isPromise(this._chunks)) {
47
- const chunks$ = this._chunks;
48
- this._generatedBody = new PonyfillReadableStream({
49
- start: controller => {
50
- chunks$.then(chunks => {
51
- this._buffer = Buffer.concat(chunks);
52
- for (const chunk of chunks) {
53
- controller.enqueue(chunk);
54
- }
55
- controller.close();
56
- });
57
- },
58
- });
59
- }
60
- else {
61
- this._buffer = Buffer.concat(this._chunks);
62
- this._generatedBody = new PonyfillReadableStream(Readable.from(this._buffer));
63
- }
64
- return this._generatedBody;
65
- }
66
42
  if (this._generatedBody?.readable?.destroyed && this._buffer) {
67
43
  this._generatedBody.readable = Readable.from(this._buffer);
68
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.7.23-alpha-20250726021628-c861bb0cd6c3ada6f0e3083708b8efbc457229ab",
3
+ "version": "0.7.23-alpha-20250726021906-27dea3e7c5dae7285bf9c837cce54f387e269df2",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "dependencies": {