Skip to main content
Module

x/ahh/src/option.ts

Opinionated idiomatic features for TypeScript.
Latest
import * as ahh from "https://deno.land/x/ahh@v0.14.0/src/option.ts";

Optionals.

The Option type defined here is nothing special, it's the same as what the rest of the ecosystem already uses. Thanks to this, we still benefit from the built-in language features for nullish types, such as:

Functions

Returns whether option is a None value.

Returns whether option is a Some value.

Returns the result of fn appied to the value of option, if it is a Some.

Returns the values of option as a tuple of Options.

Returns the values of option and other as a tuple if both are Somes.

Type Aliases

A value that is [nullish]; either undefined or null.

A value that is either None or Some.

A value that is non-[nullish].