msw 0.49.2 → 1.0.0
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/{SetupServerApi-70cc71a7.d.ts → SetupServerApi-39df862c.d.ts} +2 -2
- package/lib/{SetupApi-b2f0e5ac.d.ts → glossary-de6278a9.d.ts} +57 -15
- package/lib/iife/index.js +228 -488
- package/lib/iife/index.js.map +1 -1
- package/lib/index.d.ts +18 -8
- package/lib/index.js +43 -30
- package/lib/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/lib/native/index.d.ts +4 -3
- package/lib/native/index.js +2 -2
- package/lib/native/index.mjs +3 -3
- package/lib/node/index.d.ts +5 -5
- package/lib/node/index.js +4 -2
- package/lib/node/index.js.map +1 -1
- package/lib/node/index.mjs +4 -3
- package/lib/node/index.mjs.map +1 -1
- package/package.json +2 -2
- package/lib/glossary-a30fab39.d.ts +0 -45
package/lib/mockServiceWorker.js
CHANGED
package/lib/native/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as SetupServerApi } from '../SetupServerApi-
|
|
1
|
+
import { c as RequestHandler } from '../glossary-de6278a9.js';
|
|
2
|
+
import { S as SetupServerApi } from '../SetupServerApi-39df862c.js';
|
|
3
3
|
import 'strict-event-emitter';
|
|
4
|
-
import '
|
|
4
|
+
import 'type-fest';
|
|
5
5
|
import '@mswjs/interceptors';
|
|
6
|
+
import 'headers-polyfill';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Sets up a requests interception in React Native with the given request handlers.
|
package/lib/native/index.js
CHANGED
|
@@ -110,8 +110,8 @@ var SetupApi = class {
|
|
|
110
110
|
this.validateHandlers(...initialHandlers);
|
|
111
111
|
this.initialHandlers = toReadonlyArray(initialHandlers);
|
|
112
112
|
this.currentHandlers = [...initialHandlers];
|
|
113
|
-
this.emitter = new import_strict_event_emitter.
|
|
114
|
-
this.publicEmitter = new import_strict_event_emitter.
|
|
113
|
+
this.emitter = new import_strict_event_emitter.Emitter();
|
|
114
|
+
this.publicEmitter = new import_strict_event_emitter.Emitter();
|
|
115
115
|
pipeEvents(this.emitter, this.publicEmitter);
|
|
116
116
|
this.events = this.createLifeCycleEvents();
|
|
117
117
|
}
|
package/lib/native/index.mjs
CHANGED
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
|
|
64
64
|
// src/SetupApi.ts
|
|
65
65
|
import { invariant } from "outvariant";
|
|
66
|
-
import {
|
|
66
|
+
import { Emitter } from "strict-event-emitter";
|
|
67
67
|
|
|
68
68
|
// src/utils/internal/devUtils.ts
|
|
69
69
|
import { format } from "outvariant";
|
|
@@ -110,8 +110,8 @@ var SetupApi = class {
|
|
|
110
110
|
this.validateHandlers(...initialHandlers);
|
|
111
111
|
this.initialHandlers = toReadonlyArray(initialHandlers);
|
|
112
112
|
this.currentHandlers = [...initialHandlers];
|
|
113
|
-
this.emitter = new
|
|
114
|
-
this.publicEmitter = new
|
|
113
|
+
this.emitter = new Emitter();
|
|
114
|
+
this.publicEmitter = new Emitter();
|
|
115
115
|
pipeEvents(this.emitter, this.publicEmitter);
|
|
116
116
|
this.events = this.createLifeCycleEvents();
|
|
117
117
|
}
|
package/lib/node/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { S as SetupServerApi } from '../SetupServerApi-
|
|
2
|
-
export { a as ServerLifecycleEventsMap } from '../SetupServerApi-
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
1
|
+
import { S as SetupServerApi } from '../SetupServerApi-39df862c.js';
|
|
2
|
+
export { a as ServerLifecycleEventsMap, S as SetupServerApi } from '../SetupServerApi-39df862c.js';
|
|
3
|
+
import { c as RequestHandler } from '../glossary-de6278a9.js';
|
|
4
|
+
export { K as SetupServer } from '../glossary-de6278a9.js';
|
|
5
5
|
import '@mswjs/interceptors';
|
|
6
6
|
import 'strict-event-emitter';
|
|
7
|
-
import 'headers-polyfill';
|
|
8
7
|
import 'type-fest';
|
|
8
|
+
import 'headers-polyfill';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Sets up a requests interception in Node.js with the given request handlers.
|
package/lib/node/index.js
CHANGED
|
@@ -51,6 +51,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
51
51
|
// src/node/index.ts
|
|
52
52
|
var node_exports = {};
|
|
53
53
|
__export(node_exports, {
|
|
54
|
+
SetupServerApi: () => SetupServerApi,
|
|
54
55
|
setupServer: () => setupServer
|
|
55
56
|
});
|
|
56
57
|
module.exports = __toCommonJS(node_exports);
|
|
@@ -113,8 +114,8 @@ var SetupApi = class {
|
|
|
113
114
|
this.validateHandlers(...initialHandlers);
|
|
114
115
|
this.initialHandlers = toReadonlyArray(initialHandlers);
|
|
115
116
|
this.currentHandlers = [...initialHandlers];
|
|
116
|
-
this.emitter = new import_strict_event_emitter.
|
|
117
|
-
this.publicEmitter = new import_strict_event_emitter.
|
|
117
|
+
this.emitter = new import_strict_event_emitter.Emitter();
|
|
118
|
+
this.publicEmitter = new import_strict_event_emitter.Emitter();
|
|
118
119
|
pipeEvents(this.emitter, this.publicEmitter);
|
|
119
120
|
this.events = this.createLifeCycleEvents();
|
|
120
121
|
}
|
|
@@ -1489,6 +1490,7 @@ var setupServer = (...handlers) => {
|
|
|
1489
1490
|
};
|
|
1490
1491
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1491
1492
|
0 && (module.exports = {
|
|
1493
|
+
SetupServerApi,
|
|
1492
1494
|
setupServer
|
|
1493
1495
|
});
|
|
1494
1496
|
//# sourceMappingURL=index.js.map
|