Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/mod.ts>decoder.string

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
variable decoder.string
import { decoder } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { string } = decoder;

A Decoder that validates strings.

Examples

Example 1

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

const result1 = D.string(null); // Left(DecodeError)
const result2 = D.string("Hello"); // Right("Hello")

type

Decoder<unknown, string>