Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fun/decoder.ts>isKey

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

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

Examples

Example 1

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

const result1 = D.isKey(D.keyErr(
  "one",
  D.leafErr(1, "expected string")
)); // true
const result2 = D.isKey(D.manyErr()); // false

Returns

err is Key