@whatwg-node/fetch 0.2.8 → 0.2.9

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,11 @@
1
1
  # @whatwg-node/fetch
2
2
 
3
+ ## 0.2.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9a8d873`](https://github.com/ardatan/whatwg-node/commit/9a8d8731ff07ea585b1e561718584fbe5edeb963) Thanks [@ardatan](https://github.com/ardatan)! - Workaround for a potential leak on Node 18
8
+
3
9
  ## 0.2.3
4
10
 
5
11
  ### Minor Changes
@@ -23,7 +23,7 @@ module.exports = function createNodePonyfill(opts = {}) {
23
23
  if (!globalThis.Event || !globalThis.EventTarget) {
24
24
  require('event-target-polyfill');
25
25
  }
26
-
26
+
27
27
  ponyfills.Event = globalThis.Event;
28
28
  ponyfills.EventTarget = globalThis.EventTarget;
29
29
 
@@ -198,7 +198,8 @@ module.exports = function createNodePonyfill(opts = {}) {
198
198
 
199
199
  const fetch = function (requestOrUrl, options) {
200
200
  if (typeof requestOrUrl === "string") {
201
- return fetch(new Request(requestOrUrl, options));
201
+ // We cannot use our ctor because it leaks on Node 18's global fetch
202
+ return originalFetch(requestOrUrl, options);
202
203
  }
203
204
  if (requestOrUrl.url.startsWith('file:')) {
204
205
  return handleFileRequest(requestOrUrl.url, ponyfills.Response);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/fetch",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Cross Platform Smart Fetch Ponyfill",
5
5
  "author": "Arda TANRIKULU <ardatanrikulu@gmail.com>",
6
6
  "repository": {