@whatwg-node/fetch 0.4.5-alpha-20220926022311-d4721dd → 0.4.5
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.
- package/CHANGELOG.md +2 -2
- package/dist/create-node-ponyfill.js +0 -19
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @whatwg-node/fetch
|
|
2
2
|
|
|
3
|
-
## 0.4.5
|
|
3
|
+
## 0.4.5
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- [#140](https://github.com/ardatan/whatwg-node/pull/140) [`
|
|
7
|
+
- [#140](https://github.com/ardatan/whatwg-node/pull/140) [`5d151df`](https://github.com/ardatan/whatwg-node/commit/5d151df8c59329a470b8ffa6e3547aae72a7e55b) Thanks [@ardatan](https://github.com/ardatan)! - Fix Request.formData method
|
|
8
8
|
|
|
9
9
|
## 0.4.4
|
|
10
10
|
|
|
@@ -165,25 +165,6 @@ module.exports = function createNodePonyfill(opts = {}) {
|
|
|
165
165
|
constructor(requestOrUrl, options) {
|
|
166
166
|
if (typeof requestOrUrl === "string") {
|
|
167
167
|
options = options || {};
|
|
168
|
-
if (options.body != null && options.body.read && options.body.on) {
|
|
169
|
-
const readable = options.body;
|
|
170
|
-
options.body = new ponyfills.ReadableStream({
|
|
171
|
-
pull(controller) {
|
|
172
|
-
const chunk = readable.read();
|
|
173
|
-
if (chunk != null) {
|
|
174
|
-
controller.enqueue(chunk);
|
|
175
|
-
} else {
|
|
176
|
-
controller.close();
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
close(e) {
|
|
180
|
-
readable.destroy(e);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
Object.defineProperty(options.body, Symbol.asyncIterator, {
|
|
184
|
-
value: () => readable[Symbol.asyncIterator]()
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
168
|
super(requestOrUrl, options);
|
|
188
169
|
const contentType = this.headers.get("content-type");
|
|
189
170
|
if (contentType && contentType.startsWith("multipart/form-data")) {
|