msw 0.45.0 → 0.46.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/{glossary-297d38ba.d.ts → glossary-c690f512.d.ts} +17 -7
- package/lib/iife/index.js +12 -1
- package/lib/iife/index.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +12 -1
- package/lib/index.js.map +1 -1
- package/lib/mockServiceWorker.js +2 -2
- package/lib/native/index.d.ts +1 -1
- package/lib/native/index.js +12 -1
- package/lib/native/index.mjs +12 -1
- package/lib/node/index.d.ts +2 -2
- package/lib/node/index.js +12 -1
- package/lib/node/index.js.map +1 -1
- package/lib/node/index.mjs +12 -1
- package/lib/node/index.mjs.map +1 -1
- package/package.json +4 -4
package/lib/node/index.mjs
CHANGED
|
@@ -1225,6 +1225,13 @@ function pipeEvents(source, destination) {
|
|
|
1225
1225
|
source.emit._isPiped = true;
|
|
1226
1226
|
}
|
|
1227
1227
|
|
|
1228
|
+
// src/utils/internal/toReadonlyArray.ts
|
|
1229
|
+
function toReadonlyArray(source) {
|
|
1230
|
+
const clone = [...source];
|
|
1231
|
+
Object.freeze(clone);
|
|
1232
|
+
return clone;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1228
1235
|
// src/node/createSetupServer.ts
|
|
1229
1236
|
var DEFAULT_LISTEN_OPTIONS = {
|
|
1230
1237
|
onUnhandledRequest: "warn"
|
|
@@ -1296,8 +1303,12 @@ function createSetupServer(...interceptors) {
|
|
|
1296
1303
|
resetHandlers(...nextHandlers) {
|
|
1297
1304
|
currentHandlers = resetHandlers(requestHandlers, ...nextHandlers);
|
|
1298
1305
|
},
|
|
1306
|
+
listHandlers() {
|
|
1307
|
+
return toReadonlyArray(currentHandlers);
|
|
1308
|
+
},
|
|
1299
1309
|
printHandlers() {
|
|
1300
|
-
|
|
1310
|
+
const handlers = this.listHandlers();
|
|
1311
|
+
handlers.forEach((handler) => {
|
|
1301
1312
|
const { header, callFrame } = handler.info;
|
|
1302
1313
|
const pragma = handler.info.hasOwnProperty("operationType") ? "[graphql]" : "[rest]";
|
|
1303
1314
|
console.log(`${bold(`${pragma} ${header}`)}
|