import { predicate } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { or } = predicate;
Creates the union of two predicates, returning true if either predicate returns true.
Examples
Example 1
Example 1
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