@whatwg-node/node-fetch 0.4.16 → 0.4.17-rc-20230901135127-ada6383

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/cjs/utils.js CHANGED
@@ -36,12 +36,15 @@ function fakePromise(value) {
36
36
  // Write a fake promise to avoid the promise constructor
37
37
  // being called with `new Promise` in the browser.
38
38
  return {
39
- then: (resolve) => {
40
- const callbackResult = resolve(value);
41
- if (isPromise(callbackResult)) {
42
- return callbackResult;
39
+ then(resolve) {
40
+ if (resolve) {
41
+ const callbackResult = resolve(value);
42
+ if (isPromise(callbackResult)) {
43
+ return callbackResult;
44
+ }
45
+ return fakePromise(callbackResult);
43
46
  }
44
- return fakePromise(callbackResult);
47
+ return this;
45
48
  },
46
49
  catch() {
47
50
  return this;
package/esm/utils.js CHANGED
@@ -31,12 +31,15 @@ export function fakePromise(value) {
31
31
  // Write a fake promise to avoid the promise constructor
32
32
  // being called with `new Promise` in the browser.
33
33
  return {
34
- then: (resolve) => {
35
- const callbackResult = resolve(value);
36
- if (isPromise(callbackResult)) {
37
- return callbackResult;
34
+ then(resolve) {
35
+ if (resolve) {
36
+ const callbackResult = resolve(value);
37
+ if (isPromise(callbackResult)) {
38
+ return callbackResult;
39
+ }
40
+ return fakePromise(callbackResult);
38
41
  }
39
- return fakePromise(callbackResult);
42
+ return this;
40
43
  },
41
44
  catch() {
42
45
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.4.16",
3
+ "version": "0.4.17-rc-20230901135127-ada6383",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "dependencies": {