Skip to main content
Module

x/fun/decoder.ts>isIndex

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

A refinement that returns true when a DecodeError is an Index.

Examples

Example 1

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

const result1 = D.isIndex(D.indexErr(
  1,
  D.leafErr(1, "expected string")
)); // true
const result2 = D.isIndex(D.manyErr()); // false