msw 0.47.4 → 0.48.1
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/{glossary-dc3fd077.d.ts → SetupApi-75fbec12.d.ts} +20 -41
- package/lib/SetupServerApi-49722346.d.ts +20 -0
- package/lib/glossary-a22f5c13.d.ts +45 -0
- package/lib/iife/index.js +2660 -2645
- package/lib/iife/index.js.map +1 -1
- package/lib/index.d.ts +19 -8
- package/lib/index.js +161 -145
- package/lib/index.js.map +1 -1
- package/lib/mockServiceWorker.js +3 -3
- package/lib/native/index.d.ts +10 -5
- package/lib/native/index.js +339 -331
- package/lib/native/index.mjs +352 -330
- package/lib/node/index.d.ts +8 -6
- package/lib/node/index.js +340 -334
- package/lib/node/index.js.map +1 -1
- package/lib/node/index.mjs +354 -334
- package/lib/node/index.mjs.map +1 -1
- package/package.json +2 -1
package/lib/mockServiceWorker.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
/* tslint:disable */
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Mock Service Worker (0.
|
|
5
|
+
* Mock Service Worker (0.48.1).
|
|
6
6
|
* @see https://github.com/mswjs/msw
|
|
7
7
|
* - Please do NOT modify this file.
|
|
8
8
|
* - Please do NOT serve this file on production.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
const INTEGRITY_CHECKSUM = '
|
|
11
|
+
const INTEGRITY_CHECKSUM = '3d6b9f06410d179a7f7404d4bf4c3c70'
|
|
12
12
|
const activeClientIds = new Set()
|
|
13
13
|
|
|
14
14
|
self.addEventListener('install', function () {
|
|
@@ -174,7 +174,7 @@ async function handleRequest(event, requestId) {
|
|
|
174
174
|
async function resolveMainClient(event) {
|
|
175
175
|
const client = await self.clients.get(event.clientId)
|
|
176
176
|
|
|
177
|
-
if (client
|
|
177
|
+
if (client?.frameType === 'top-level') {
|
|
178
178
|
return client
|
|
179
179
|
}
|
|
180
180
|
|
package/lib/native/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { b as RequestHandler
|
|
2
|
-
import '
|
|
3
|
-
import '@mswjs/interceptors';
|
|
4
|
-
import 'headers-polyfill';
|
|
1
|
+
import { b as RequestHandler } from '../SetupApi-75fbec12.js';
|
|
2
|
+
import { S as SetupServerApi } from '../SetupServerApi-49722346.js';
|
|
5
3
|
import 'strict-event-emitter';
|
|
4
|
+
import 'headers-polyfill';
|
|
5
|
+
import '@mswjs/interceptors';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Sets up a requests interception in React Native with the given request handlers.
|
|
9
|
+
* @param {RequestHandler[]} handlers List of request handlers.
|
|
10
|
+
* @see {@link https://mswjs.io/docs/api/setup-server `setupServer`}
|
|
11
|
+
*/
|
|
12
|
+
declare function setupServer(...handlers: Array<RequestHandler>): SetupServerApi;
|
|
8
13
|
|
|
9
14
|
export { setupServer };
|