@zimic/interceptor 1.2.5 → 1.2.6-canary.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/dist/{chunk-7GKHYQ2U.mjs → chunk-6GEP6R3L.mjs} +29 -25
- package/dist/chunk-6GEP6R3L.mjs.map +1 -0
- package/dist/{chunk-ZZGHTY2X.js → chunk-PB4TJVK3.js} +29 -25
- package/dist/chunk-PB4TJVK3.js.map +1 -0
- package/dist/cli.js +17 -17
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/http.js +10 -8
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +10 -8
- package/dist/http.mjs.map +1 -1
- package/dist/server.js +6 -6
- package/dist/server.mjs +1 -1
- package/package.json +1 -1
- package/src/server/InterceptorServer.ts +1 -1
- package/src/server/constants.ts +1 -1
- package/src/utils/http.ts +0 -92
- package/src/webSocket/WebSocketHandler.ts +10 -10
- package/dist/chunk-7GKHYQ2U.mjs.map +0 -1
- package/dist/chunk-ZZGHTY2X.js.map +0 -1
package/dist/http.mjs
CHANGED
|
@@ -1009,6 +1009,8 @@ function removeArrayElement(array, element) {
|
|
|
1009
1009
|
const index = array.indexOf(element);
|
|
1010
1010
|
return removeArrayIndex(array, index);
|
|
1011
1011
|
}
|
|
1012
|
+
|
|
1013
|
+
// src/utils/http.ts
|
|
1012
1014
|
var HTTP_METHODS_WITH_RESPONSE_BODY = /* @__PURE__ */ new Set([
|
|
1013
1015
|
"GET",
|
|
1014
1016
|
"POST",
|
|
@@ -2261,6 +2263,14 @@ var WebSocketHandler = class {
|
|
|
2261
2263
|
listeners[type].add(listener);
|
|
2262
2264
|
return listener;
|
|
2263
2265
|
}
|
|
2266
|
+
offAny() {
|
|
2267
|
+
this.channelListeners = {};
|
|
2268
|
+
for (const listenersBySocket of Object.values(this.socketListeners)) {
|
|
2269
|
+
for (const listeners of listenersBySocket.values()) {
|
|
2270
|
+
listeners.clear();
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2264
2274
|
getOrCreateChannelListeners(channel) {
|
|
2265
2275
|
const listeners = this.channelListeners[channel] ?? {
|
|
2266
2276
|
event: /* @__PURE__ */ new Set(),
|
|
@@ -2296,14 +2306,6 @@ var WebSocketHandler = class {
|
|
|
2296
2306
|
listener(options);
|
|
2297
2307
|
}
|
|
2298
2308
|
}
|
|
2299
|
-
offAny() {
|
|
2300
|
-
this.channelListeners = {};
|
|
2301
|
-
for (const listenersBySocket of Object.values(this.socketListeners)) {
|
|
2302
|
-
for (const listeners of listenersBySocket.values()) {
|
|
2303
|
-
listeners.clear();
|
|
2304
|
-
}
|
|
2305
|
-
}
|
|
2306
|
-
}
|
|
2307
2309
|
};
|
|
2308
2310
|
var WebSocketHandler_default = WebSocketHandler;
|
|
2309
2311
|
|