@whatwg-node/node-fetch 0.4.5-alpha-20230613171038-bc4cd83 → 0.4.5-alpha-20230613171450-41cad7c

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 +13 -13
  2. package/esm/Body.js +13 -13
  3. package/package.json +1 -1
package/cjs/Body.js CHANGED
@@ -231,19 +231,6 @@ function processBodyInit(bodyInit) {
231
231
  contentLength: null,
232
232
  };
233
233
  }
234
- if (bodyInit instanceof Buffer) {
235
- const contentLength = bodyInit.byteLength;
236
- return {
237
- bodyType: BodyInitType.Buffer,
238
- contentLength,
239
- contentType: null,
240
- bodyFactory() {
241
- const readable = stream_1.Readable.from(bodyInit);
242
- const body = new ReadableStream_js_1.PonyfillReadableStream(readable);
243
- return body;
244
- },
245
- };
246
- }
247
234
  if (typeof bodyInit === 'string') {
248
235
  const buffer = Buffer.from(bodyInit);
249
236
  const contentLength = buffer.byteLength;
@@ -257,6 +244,19 @@ function processBodyInit(bodyInit) {
257
244
  },
258
245
  };
259
246
  }
247
+ if (bodyInit instanceof Buffer) {
248
+ const contentLength = bodyInit.byteLength;
249
+ return {
250
+ bodyType: BodyInitType.Buffer,
251
+ contentLength,
252
+ contentType: null,
253
+ bodyFactory() {
254
+ const readable = stream_1.Readable.from(bodyInit);
255
+ const body = new ReadableStream_js_1.PonyfillReadableStream(readable);
256
+ return body;
257
+ },
258
+ };
259
+ }
260
260
  if (bodyInit instanceof ReadableStream_js_1.PonyfillReadableStream) {
261
261
  return {
262
262
  bodyType: BodyInitType.ReadableStream,
package/esm/Body.js CHANGED
@@ -226,19 +226,6 @@ function processBodyInit(bodyInit) {
226
226
  contentLength: null,
227
227
  };
228
228
  }
229
- if (bodyInit instanceof Buffer) {
230
- const contentLength = bodyInit.byteLength;
231
- return {
232
- bodyType: BodyInitType.Buffer,
233
- contentLength,
234
- contentType: null,
235
- bodyFactory() {
236
- const readable = Readable.from(bodyInit);
237
- const body = new PonyfillReadableStream(readable);
238
- return body;
239
- },
240
- };
241
- }
242
229
  if (typeof bodyInit === 'string') {
243
230
  const buffer = Buffer.from(bodyInit);
244
231
  const contentLength = buffer.byteLength;
@@ -252,6 +239,19 @@ function processBodyInit(bodyInit) {
252
239
  },
253
240
  };
254
241
  }
242
+ if (bodyInit instanceof Buffer) {
243
+ const contentLength = bodyInit.byteLength;
244
+ return {
245
+ bodyType: BodyInitType.Buffer,
246
+ contentLength,
247
+ contentType: null,
248
+ bodyFactory() {
249
+ const readable = Readable.from(bodyInit);
250
+ const body = new PonyfillReadableStream(readable);
251
+ return body;
252
+ },
253
+ };
254
+ }
255
255
  if (bodyInit instanceof PonyfillReadableStream) {
256
256
  return {
257
257
  bodyType: BodyInitType.ReadableStream,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.4.5-alpha-20230613171038-bc4cd83",
3
+ "version": "0.4.5-alpha-20230613171450-41cad7c",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "dependencies": {