@whatwg-node/fetch 0.1.1 → 0.2.2
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 +6 -0
- package/dist/create-node-ponyfill.js +4 -0
- package/dist/deno-ponyfill.ts +4 -0
- package/dist/global-ponyfill.js +2 -0
- package/dist/index.d.ts +7 -1
- package/dist/node-ponyfill.js +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,10 @@ module.exports = function createNodePonyfill(opts = {}) {
|
|
|
19
19
|
ponyfills.Blob = globalThis.Blob;
|
|
20
20
|
ponyfills.crypto = globalThis.crypto;
|
|
21
21
|
|
|
22
|
+
require('event-target-polyfill');
|
|
23
|
+
ponyfills.Event = globalThis.Event;
|
|
24
|
+
ponyfills.EventTarget = globalThis.EventTarget;
|
|
25
|
+
|
|
22
26
|
if (!ponyfills.AbortController) {
|
|
23
27
|
const abortControllerModule = require("abort-controller");
|
|
24
28
|
ponyfills.AbortController =
|
package/dist/deno-ponyfill.ts
CHANGED
|
@@ -12,6 +12,8 @@ const File = globalThis.File;
|
|
|
12
12
|
const crypto = globalThis.crypto;
|
|
13
13
|
const TextDecoder = globalThis.TextDecoder;
|
|
14
14
|
const TextEncoder = globalThis.TextEncoder;
|
|
15
|
+
const Event = globalThis.Event;
|
|
16
|
+
const EventTarget = globalThis.EventTarget;
|
|
15
17
|
|
|
16
18
|
export const create = () => globalThis;
|
|
17
19
|
export {
|
|
@@ -29,4 +31,6 @@ export {
|
|
|
29
31
|
crypto,
|
|
30
32
|
TextDecoder,
|
|
31
33
|
TextEncoder,
|
|
34
|
+
Event,
|
|
35
|
+
EventTarget,
|
|
32
36
|
};
|
package/dist/global-ponyfill.js
CHANGED
|
@@ -12,4 +12,6 @@ module.exports.File = globalThis.File;
|
|
|
12
12
|
module.exports.crypto = globalThis.crypto;
|
|
13
13
|
module.exports.TextEncoder = globalThis.TextEncoder;
|
|
14
14
|
module.exports.TextDecoder = globalThis.TextDecoder;
|
|
15
|
+
module.exports.Event = globalThis.Event;
|
|
16
|
+
module.exports.EventTarget = globalThis.EventTarget;
|
|
15
17
|
module.exports.createFetch = () => globalThis;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ declare const _File: typeof File;
|
|
|
14
14
|
declare const _crypto: typeof crypto;
|
|
15
15
|
declare const _TextEncoder: typeof TextEncoder;
|
|
16
16
|
declare const _TextDecoder: typeof TextDecoder;
|
|
17
|
+
declare const _Event: typeof Event;
|
|
18
|
+
declare const _EventTarget: typeof EventTarget;
|
|
17
19
|
|
|
18
20
|
declare module "@whatwg-node/fetch" {
|
|
19
21
|
export const fetch: typeof _fetch;
|
|
@@ -30,6 +32,8 @@ declare module "@whatwg-node/fetch" {
|
|
|
30
32
|
export const crypto: typeof _crypto;
|
|
31
33
|
export const TextDecoder: typeof _TextDecoder;
|
|
32
34
|
export const TextEncoder: typeof _TextEncoder;
|
|
35
|
+
export const Event: typeof _Event;
|
|
36
|
+
export const EventTarget: typeof EventTarget;
|
|
33
37
|
export interface FormDataLimits {
|
|
34
38
|
/* Max field name size (in bytes). Default: 100. */
|
|
35
39
|
fieldNameSize?: number;
|
|
@@ -60,7 +64,9 @@ declare module "@whatwg-node/fetch" {
|
|
|
60
64
|
File: typeof _File,
|
|
61
65
|
crypto: typeof _crypto
|
|
62
66
|
TextEncoder: typeof _TextEncoder,
|
|
63
|
-
TextDecoder: typeof _TextDecoder
|
|
67
|
+
TextDecoder: typeof _TextDecoder,
|
|
68
|
+
Event: typeof _Event,
|
|
69
|
+
EventTarget: typeof EventTarget
|
|
64
70
|
});
|
|
65
71
|
}
|
|
66
72
|
|
package/dist/node-ponyfill.js
CHANGED
|
@@ -16,6 +16,7 @@ module.exports.File = ponyfills.File;
|
|
|
16
16
|
module.exports.crypto = ponyfills.crypto;
|
|
17
17
|
module.exports.TextEncoder = ponyfills.TextEncoder;
|
|
18
18
|
module.exports.TextDecoder = ponyfills.TextDecoder;
|
|
19
|
-
exports.
|
|
19
|
+
module.exports.Event = ponyfills.Event;
|
|
20
|
+
module.exports.EventTarget = ponyfills.EventTarget;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
exports.createFetch = createNodePonyfill;
|