@whatwg-node/fetch 0.2.4 → 0.2.7

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.
@@ -1,6 +1,7 @@
1
1
  const handleFileRequest = require("./handle-file-request");
2
2
 
3
3
  module.exports = function createNodePonyfill(opts = {}) {
4
+
4
5
  const ponyfills = {};
5
6
 
6
7
  if (!opts.useNodeFetch) {
@@ -227,7 +228,7 @@ module.exports = function createNodePonyfill(opts = {}) {
227
228
  if (globalThis.Headers) {
228
229
  Object.defineProperty(globalThis.Headers, Symbol.hasInstance, {
229
230
  value(obj) {
230
- return obj.get && obj.set && obj.delete && obj.has && obj.append;
231
+ return obj && obj.get && obj.set && obj.delete && obj.has && obj.append;
231
232
  },
232
233
  configurable: true,
233
234
  })
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference lib="dom" />
2
-
3
1
  declare const _fetch: typeof fetch;
4
2
  declare const _Request: typeof Request;
5
3
  declare const _Response: typeof Response;
@@ -33,7 +31,7 @@ declare module "@whatwg-node/fetch" {
33
31
  export const TextDecoder: typeof _TextDecoder;
34
32
  export const TextEncoder: typeof _TextEncoder;
35
33
  export const Event: typeof _Event;
36
- export const EventTarget: typeof EventTarget;
34
+ export const EventTarget: typeof _EventTarget;
37
35
  export interface FormDataLimits {
38
36
  /* Max field name size (in bytes). Default: 100. */
39
37
  fieldNameSize?: number;
@@ -66,7 +64,7 @@ declare module "@whatwg-node/fetch" {
66
64
  TextEncoder: typeof _TextEncoder,
67
65
  TextDecoder: typeof _TextDecoder,
68
66
  Event: typeof _Event,
69
- EventTarget: typeof EventTarget
67
+ EventTarget: typeof _EventTarget
70
68
  });
71
69
  }
72
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/fetch",
3
- "version": "0.2.4",
3
+ "version": "0.2.7",
4
4
  "description": "Cross Platform Smart Fetch Ponyfill",
5
5
  "author": "Arda TANRIKULU <ardatanrikulu@gmail.com>",
6
6
  "repository": {