@whatwg-node/node-fetch 0.0.3 → 0.0.4

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/index.js +2 -3
  2. package/index.mjs +2 -3
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -559,10 +559,9 @@ function processBodyInit(bodyInit) {
559
559
  return {
560
560
  bodyType: BodyInitType.String,
561
561
  contentType: 'text/plain;charset=UTF-8',
562
- contentLength: bodyInit.length,
562
+ contentLength: Buffer.byteLength(bodyInit),
563
563
  bodyFactory() {
564
- const buffer = Buffer.from(bodyInit);
565
- const readable = stream.Readable.from(buffer);
564
+ const readable = stream.Readable.from(bodyInit);
566
565
  return new PonyfillReadableStream(readable);
567
566
  },
568
567
  };
package/index.mjs CHANGED
@@ -553,10 +553,9 @@ function processBodyInit(bodyInit) {
553
553
  return {
554
554
  bodyType: BodyInitType.String,
555
555
  contentType: 'text/plain;charset=UTF-8',
556
- contentLength: bodyInit.length,
556
+ contentLength: Buffer.byteLength(bodyInit),
557
557
  bodyFactory() {
558
- const buffer = Buffer.from(bodyInit);
559
- const readable = Readable.from(buffer);
558
+ const readable = Readable.from(bodyInit);
560
559
  return new PonyfillReadableStream(readable);
561
560
  },
562
561
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {