and
import { and } from "https://raw.githubusercontent.com/baetheus/fun/main/predicate.ts";
Creates the intersection of two predicates, returning true if both predicates return true.
@example
import { and } from "./predicate.ts";
import { pipe } from "./fn.ts";
const isPositive = (n: number) => n > 0;
const isInteger = (n: number) => Number.isInteger(n);
const isPositiveInteger = pipe(
isPositive,
and(isInteger),
);
const result1 = isPositiveInteger(1); // true
const result2 = isPositiveInteger(100); // true
const result3 = isPositiveInteger(-1); // false