msw 0.49.1 → 0.49.3
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/lib/{SetupApi-b2f0e5ac.d.ts → SetupApi-f4099ef3.d.ts} +13 -12
- package/lib/{SetupServerApi-70cc71a7.d.ts → SetupServerApi-db0805bd.d.ts} +1 -1
- package/lib/{glossary-a30fab39.d.ts → glossary-6c6965e4.d.ts} +1 -1
- package/lib/iife/index.js +183 -455
- package/lib/iife/index.js.map +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/lib/native/index.d.ts +2 -2
- package/lib/native/index.js +3 -3
- package/lib/native/index.mjs +4 -4
- package/lib/node/index.d.ts +4 -4
- package/lib/node/index.js +3 -3
- package/lib/node/index.js.map +1 -1
- package/lib/node/index.mjs +4 -4
- package/lib/node/index.mjs.map +1 -1
- package/package.json +2 -2
package/lib/node/index.mjs
CHANGED
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
|
|
65
65
|
// src/SetupApi.ts
|
|
66
66
|
import { invariant } from "outvariant";
|
|
67
|
-
import {
|
|
67
|
+
import { Emitter } from "strict-event-emitter";
|
|
68
68
|
|
|
69
69
|
// src/utils/internal/devUtils.ts
|
|
70
70
|
import { format } from "outvariant";
|
|
@@ -111,8 +111,8 @@ var SetupApi = class {
|
|
|
111
111
|
this.validateHandlers(...initialHandlers);
|
|
112
112
|
this.initialHandlers = toReadonlyArray(initialHandlers);
|
|
113
113
|
this.currentHandlers = [...initialHandlers];
|
|
114
|
-
this.emitter = new
|
|
115
|
-
this.publicEmitter = new
|
|
114
|
+
this.emitter = new Emitter();
|
|
115
|
+
this.publicEmitter = new Emitter();
|
|
116
116
|
pipeEvents(this.emitter, this.publicEmitter);
|
|
117
117
|
this.events = this.createLifeCycleEvents();
|
|
118
118
|
}
|
|
@@ -767,7 +767,7 @@ var errors = (errorsList) => {
|
|
|
767
767
|
// src/context/fetch.ts
|
|
768
768
|
import { isNodeProcess as isNodeProcess2 } from "is-node-process";
|
|
769
769
|
import { Headers as Headers2 } from "headers-polyfill";
|
|
770
|
-
var useFetch = isNodeProcess2() ? (input, init) => Promise.resolve().then(() => __toESM(__require("node-fetch"))).then(({ default: nodeFetch }) => nodeFetch(input, init)) :
|
|
770
|
+
var useFetch = isNodeProcess2() ? (input, init) => Promise.resolve().then(() => __toESM(__require("node-fetch"))).then(({ default: nodeFetch }) => nodeFetch(input, init)) : globalThis.fetch;
|
|
771
771
|
var augmentRequestInit = (requestInit) => {
|
|
772
772
|
const headers = new Headers2(requestInit.headers);
|
|
773
773
|
headers.set("x-msw-bypass", "true");
|