Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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
function and<A>(second: Predicate<A>): (first: Predicate<A>) => Predicate<A>;
§
and<A>(second: Predicate<A>): (first: Predicate<A>) => Predicate<A>
[src]

§Type Parameters

§Parameters

§
second: Predicate<A>
[src]

§Return Type

§
(first: Predicate<A>) => Predicate<A>
[src]