@whatwg-node/node-fetch 0.0.1-alpha-20221230075257-cc3a93b → 0.0.1-alpha-20221230080207-dec357b

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/index.js CHANGED
@@ -33,7 +33,9 @@ class PonyfillAbortSignal extends events.EventTarget {
33
33
  this._onabort = null;
34
34
  }
35
35
  throwIfAborted() {
36
- throw new PonyfillAbortError();
36
+ if (this.aborted) {
37
+ throw new PonyfillAbortError();
38
+ }
37
39
  }
38
40
  get onabort() {
39
41
  return this._onabort;
@@ -301,7 +303,7 @@ class PonyfillFormData {
301
303
  controller.enqueue(Buffer.from(`\r\n--${boundary}\r\n`));
302
304
  }
303
305
  }
304
- }
306
+ },
305
307
  });
306
308
  }
307
309
  }
@@ -332,7 +334,7 @@ class PonyfillBody {
332
334
  this._body = null;
333
335
  this.contentType = null;
334
336
  this.contentLength = null;
335
- const { body, contentType, contentLength, bodyType, } = processBodyInit(bodyInit);
337
+ const { body, contentType, contentLength, bodyType } = processBodyInit(bodyInit);
336
338
  this._body = body;
337
339
  this.contentType = contentType;
338
340
  this.contentLength = contentLength;
package/index.mjs CHANGED
@@ -27,7 +27,9 @@ class PonyfillAbortSignal extends EventTarget {
27
27
  this._onabort = null;
28
28
  }
29
29
  throwIfAborted() {
30
- throw new PonyfillAbortError();
30
+ if (this.aborted) {
31
+ throw new PonyfillAbortError();
32
+ }
31
33
  }
32
34
  get onabort() {
33
35
  return this._onabort;
@@ -295,7 +297,7 @@ class PonyfillFormData {
295
297
  controller.enqueue(Buffer.from(`\r\n--${boundary}\r\n`));
296
298
  }
297
299
  }
298
- }
300
+ },
299
301
  });
300
302
  }
301
303
  }
@@ -326,7 +328,7 @@ class PonyfillBody {
326
328
  this._body = null;
327
329
  this.contentType = null;
328
330
  this.contentLength = null;
329
- const { body, contentType, contentLength, bodyType, } = processBodyInit(bodyInit);
331
+ const { body, contentType, contentLength, bodyType } = processBodyInit(bodyInit);
330
332
  this._body = body;
331
333
  this.contentType = contentType;
332
334
  this.contentLength = contentLength;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.0.1-alpha-20221230075257-cc3a93b",
3
+ "version": "0.0.1-alpha-20221230080207-dec357b",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
package/utils.d.ts CHANGED
@@ -1,2 +1 @@
1
- export declare function headersToJSON(headers: Headers): Record<string, string>;
2
1
  export declare function getHeadersObj(headers: Headers): Record<string, string>;