Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
method matches.Parser.prototype.optional
Re-export
import { matches } from "https://deno.land/x/embassyd_sdk@v0.3.4-alpha1/dependencies.ts";
const { Parser } = 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>>