import { equalsResponse } from "https://deno.land/x/http_utils@1.0.0-beta.8/mod.ts";
Check two Response
fields equality.
Examples
Example 1
Example 1
import { equalsResponse } from "https://deno.land/x/http_utils@$VERSION/mod.ts";
import { assert } from "https://deno.land/std@$VERSION/testing/asserts.ts";
assert(
equalsResponse(
new Response(null, { status: 204, headers: { "content-length": "0" } }),
new Response(null, { status: 204, headers: { "content-length": "0" } }),
),
);
Strict check two Response
fields equality.
Examples
Example 1
Example 1
import { equalsResponse } from "https://deno.land/x/http_utils@$VERSION/mod.ts";
import { assert } from "https://deno.land/std@$VERSION/testing/asserts.ts";
assert(
await equalsResponse(
new Response("test1", { status: 200, headers: { "content-length": "5" } }),
new Response("test2", { status: 200, headers: { "content-length": "5" } }),
false,
),
);