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

or

import { or } from "https://raw.githubusercontent.com/baetheus/fun/main/predicate.ts";

Creates the union of two predicates, returning true if either predicate returns true.

@example
import { or } from "./predicate.ts";
import { string, number } from "./refinement.ts";
import { pipe } from "./fn.ts";

// A Refinement is also a Predicate
const stringOrNumber = pipe(
  string,
  or(number),
);

const result1 = stringOrNumber("Hello"); // true
const result2 = stringOrNumber(1); // true
const result3 = stringOrNumber({}); // false
function or<A>(second: Predicate<A>): (first: Predicate<A>) => Predicate<A>;
§
or<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]