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

x/ts_matches/src/matches.ts>Validator#defaultTo

Being able to pattern match in typescript
Go to Latest
method Validator.prototype.defaultTo
Re-export
import { Validator } from "https://deno.land/x/ts_matches@v5.2.1/src/matches.ts";

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>>