Skip to main content
Module

x/fun/decoder.ts>isUnion

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function isUnion
import { isUnion } from "https://deno.land/x/fun@v2.0.0/decoder.ts";

A refinement that returns true when a DecodeError is a Union.

Examples

Example 1

import * as D from "./decoder.ts";

const result1 = D.isUnion(D.unionErr(
  D.leafErr(1, "expected null"),
  D.leafErr(1, "expected string")
)); // true
const result2 = D.isUnion(D.manyErr()); // false