We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf78fbd commit ded56eaCopy full SHA for ded56ea
test/mock.ts
@@ -1,7 +1,7 @@
1
-import { HttpResponse } from "msw";
+import { HttpResponse, JsonBodyType } from "msw";
2
import { gzipSync } from "zlib";
3
4
-export function responseGzipOrJson(response: any, url: URL) {
+export function responseGzipOrJson<T extends JsonBodyType>(response: T, url: URL) {
5
if (parseInt(url.searchParams.get("gzip") ?? "0") > 0) {
6
return HttpResponse.arrayBuffer(
7
gzipSync(Buffer.from(JSON.stringify(response)))
0 commit comments