@whatwg-node/node-fetch 0.0.1-alpha-20221228080444-fb2baa0 → 0.0.1-alpha-20221228081805-75e6dc7

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 +4 -1
  2. package/index.mjs +4 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -78,7 +78,7 @@ function createController(desiredSize, readable) {
78
78
  readable.push(concatenated);
79
79
  chunks = [];
80
80
  }
81
- }
81
+ },
82
82
  };
83
83
  }
84
84
  class PonyfillReadableStream {
@@ -127,7 +127,9 @@ class PonyfillReadableStream {
127
127
  async construct(callback) {
128
128
  var _a;
129
129
  try {
130
+ const controller = createController(0, this);
130
131
  await ((_a = underlyingSource === null || underlyingSource === void 0 ? void 0 : underlyingSource.start) === null || _a === void 0 ? void 0 : _a.call(underlyingSource, createController(0, this)));
132
+ controller._flush();
131
133
  callback(null);
132
134
  }
133
135
  catch (err) {
@@ -159,6 +161,7 @@ class PonyfillReadableStream {
159
161
  }
160
162
  getReader(_options) {
161
163
  const iterator = this.readable[Symbol.asyncIterator]();
164
+ this.locked = true;
162
165
  return {
163
166
  read() {
164
167
  return iterator.next();
package/index.mjs CHANGED
@@ -74,7 +74,7 @@ function createController(desiredSize, readable) {
74
74
  readable.push(concatenated);
75
75
  chunks = [];
76
76
  }
77
- }
77
+ },
78
78
  };
79
79
  }
80
80
  class PonyfillReadableStream {
@@ -123,7 +123,9 @@ class PonyfillReadableStream {
123
123
  async construct(callback) {
124
124
  var _a;
125
125
  try {
126
+ const controller = createController(0, this);
126
127
  await ((_a = underlyingSource === null || underlyingSource === void 0 ? void 0 : underlyingSource.start) === null || _a === void 0 ? void 0 : _a.call(underlyingSource, createController(0, this)));
128
+ controller._flush();
127
129
  callback(null);
128
130
  }
129
131
  catch (err) {
@@ -155,6 +157,7 @@ class PonyfillReadableStream {
155
157
  }
156
158
  getReader(_options) {
157
159
  const iterator = this.readable[Symbol.asyncIterator]();
160
+ this.locked = true;
158
161
  return {
159
162
  read() {
160
163
  return iterator.next();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.0.1-alpha-20221228080444-fb2baa0",
3
+ "version": "0.0.1-alpha-20221228081805-75e6dc7",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {