import { eq } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { intersect } = eq;
Create a eq from two other eqs. The resultant eq checks that any two values are equal according to both supplied eqs.
Examples
Example 1
Example 1
import { intersect, struct, partial, string } from "./eq.ts";
import { pipe } from "./fn.ts";
const { equals } = pipe(
struct({ firstName: string }),
intersect(partial({ lastName: string }))
);
const batman = { firstName: "Batman" };
const grace = { firstName: "Grace", lastName: "Hopper" };
const result1 = equals(batman)(grace); // false
const result2 = equals(grace)(grace); // true