msw 0.44.2 → 0.46.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.
@@ -139,9 +139,7 @@ var devUtils = {
139
139
  import getStringMatchScore from "js-levenshtein";
140
140
 
141
141
  // src/utils/internal/parseGraphQLRequest.ts
142
- import {
143
- parse
144
- } from "graphql";
142
+ import { parse } from "graphql";
145
143
 
146
144
  // src/utils/request/getPublicUrlFromRequest.ts
147
145
  var getPublicUrlFromRequest = (request) => {
@@ -1229,6 +1227,13 @@ function pipeEvents(source, destination) {
1229
1227
  source.emit._isPiped = true;
1230
1228
  }
1231
1229
 
1230
+ // src/utils/internal/toReadonlyArray.ts
1231
+ function toReadonlyArray(source) {
1232
+ const clone = [...source];
1233
+ Object.freeze(clone);
1234
+ return clone;
1235
+ }
1236
+
1232
1237
  // src/node/createSetupServer.ts
1233
1238
  var DEFAULT_LISTEN_OPTIONS = {
1234
1239
  onUnhandledRequest: "warn"
@@ -1300,8 +1305,12 @@ function createSetupServer(...interceptors) {
1300
1305
  resetHandlers(...nextHandlers) {
1301
1306
  currentHandlers = resetHandlers(requestHandlers, ...nextHandlers);
1302
1307
  },
1308
+ listHandlers() {
1309
+ return toReadonlyArray(currentHandlers);
1310
+ },
1303
1311
  printHandlers() {
1304
- currentHandlers.forEach((handler) => {
1312
+ const handlers = this.listHandlers();
1313
+ handlers.forEach((handler) => {
1305
1314
  const { header, callFrame } = handler.info;
1306
1315
  const pragma = handler.info.hasOwnProperty("operationType") ? "[graphql]" : "[rest]";
1307
1316
  console.log(`${bold(`${pragma} ${header}`)}