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

There are times that we would like to bring in a value that we know as null or undefined and want it to go to a default value

Parameters

defaultValue: C

Returns

Parser<Optional<A>, C | NonNull<B, C>>