import { or } from "https://deno.land/x/fun@v2.0.0-alpha.12/refinement.ts";
Compose two refinements into a new refinement that returns true if either of the two input refinements return true.
Examples
Example 1
Example 1
import * as R from "./refinement.ts";
import { pipe } from "./fn.ts";
const number = (u: unknown): u is number => typeof u === "number";
const string = (u: unknown): u is string => typeof u === "string";
const refine = pipe(number, R.or(string));
const result1 = refine("Hello"); // true
const result2 = refine(null); // false
Type Parameters
C extends A
Parameters
second: Refinement<A, C>
Returns
<B extends A>(first: Refinement<A, B>) => Refinement<A, B | C>