Skip to main content
Go to Latest
method matches.Validator.prototype.optional
Re-export
import { matches } from "https://deno.land/x/embassyd_sdk@v0.3.1.1.4/mod.ts";
const { Validator } = matches;

When we want to make sure that we handle the null later on in a monoid fashion, and this ensures we deal with the value https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#optional-chaining

Parameters

optional
name: string

Returns

Parser<Optional<A>, Optional<B>>