@zimic/interceptor 0.17.3 → 0.18.0-canary.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/README.md +1 -1
- package/dist/{chunk-HPY7FBKU.js → chunk-3GG7AT63.js} +13 -4
- package/dist/chunk-3GG7AT63.js.map +1 -0
- package/dist/{chunk-2JEHCG37.mjs → chunk-NYY2KKWB.mjs} +14 -5
- package/dist/chunk-NYY2KKWB.mjs.map +1 -0
- package/dist/cli.js +18 -18
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/http.d.ts +28 -24
- package/dist/http.js +9 -2
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +10 -3
- package/dist/http.mjs.map +1 -1
- package/dist/server.js +6 -6
- package/dist/server.mjs +1 -1
- package/package.json +4 -4
- package/src/http/requestHandler/HttpRequestHandlerClient.ts +6 -4
- package/src/http/requestHandler/types/requests.ts +35 -23
- package/src/http/requestHandler/types/restrictions.ts +6 -6
- package/src/utils/http.ts +16 -13
- package/dist/chunk-2JEHCG37.mjs.map +0 -1
- package/dist/chunk-HPY7FBKU.js.map +0 -1
package/dist/http.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import color2 from 'picocolors';
|
|
2
|
-
import { HttpHeaders, HttpSearchParams, HttpFormData, HTTP_METHODS
|
|
2
|
+
import { HttpHeaders, HttpSearchParams, HttpFormData, HTTP_METHODS } from '@zimic/http';
|
|
3
3
|
import { http, passthrough } from 'msw';
|
|
4
4
|
import * as mswBrowser from 'msw/browser';
|
|
5
5
|
import * as mswNode from 'msw/node';
|
|
@@ -954,9 +954,16 @@ function removeArrayElement(array, element) {
|
|
|
954
954
|
return removeArrayIndex(array, index);
|
|
955
955
|
}
|
|
956
956
|
__name(removeArrayElement, "removeArrayElement");
|
|
957
|
+
var HTTP_METHODS_WITH_RESPONSE_BODY = /* @__PURE__ */ new Set([
|
|
958
|
+
"GET",
|
|
959
|
+
"POST",
|
|
960
|
+
"PUT",
|
|
961
|
+
"PATCH",
|
|
962
|
+
"DELETE",
|
|
963
|
+
"OPTIONS"
|
|
964
|
+
]);
|
|
957
965
|
function methodCanHaveResponseBody(method) {
|
|
958
|
-
|
|
959
|
-
return methodsToCompare.includes(method);
|
|
966
|
+
return HTTP_METHODS_WITH_RESPONSE_BODY.has(method);
|
|
960
967
|
}
|
|
961
968
|
__name(methodCanHaveResponseBody, "methodCanHaveResponseBody");
|
|
962
969
|
|