Skip to main content
Module

x/functional/mod.ts>safeExtract

Common Functional Programming Algebraic data types for JavaScript that is compatible with most modern browsers and Deno.
Latest
variable safeExtract
import { safeExtract } from "https://deno.land/x/functional@v1.3.4/mod.ts";

safeExtract

String -> Either a -> a

This function takes a message and an Either container; if the container is Either.Right, the value will be returned. But if the container is Either.Left, it will throw an error with the message passed.