@whatwg-node/fetch 0.6.3 → 0.6.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @whatwg-node/fetch
2
2
 
3
+ ## 0.6.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2ce7122`](https://github.com/ardatan/whatwg-node/commit/2ce71227f0cc86644998cad70405048d79c1b104)
8
+ Thanks [@ardatan](https://github.com/ardatan)! - Bun doesn't have URLPattern
9
+
3
10
  ## 0.6.3
4
11
 
5
12
  ### Patch Changes
@@ -1,14 +1,14 @@
1
1
  module.exports = function createNodePonyfill(opts = {}) {
2
-
3
- // Bun already has a Fetch API
4
- if (process.versions.bun) {
5
- return globalThis;
2
+ const ponyfills = {};
3
+
4
+ // We call this previously to patch `Bun`
5
+ if (!ponyfills.URLPattern) {
6
+ const urlPatternModule = require('urlpattern-polyfill');
7
+ ponyfills.URLPattern = urlPatternModule.URLPattern;
6
8
  }
7
9
 
8
10
  const newNodeFetch = require('@whatwg-node/node-fetch');
9
11
 
10
- const ponyfills = {};
11
-
12
12
  ponyfills.fetch = newNodeFetch.fetch;
13
13
  ponyfills.Request = newNodeFetch.Request;
14
14
  ponyfills.Response = newNodeFetch.Response;
@@ -75,11 +75,6 @@ module.exports = function createNodePonyfill(opts = {}) {
75
75
  const cryptoPonyfill = require('@peculiar/webcrypto');
76
76
  ponyfills.crypto = new cryptoPonyfill.Crypto();
77
77
  }
78
-
79
- if (!ponyfills.URLPattern) {
80
- const urlPatternModule = require('urlpattern-polyfill');
81
- ponyfills.URLPattern = urlPatternModule.URLPattern;
82
- }
83
78
 
84
79
  return ponyfills;
85
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/fetch",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "Cross Platform Smart Fetch Ponyfill",
5
5
  "repository": {
6
6
  "type": "git",