function fromNullable
Since 0.1.0
fromNullable<T>(value: T | null | undefined): Option<T>

Converts a nullable value to an Option.

Type Parameters

The contained value type

Parameters

value: T | null | undefined

The possibly null/undefined value

Return Type

Some when the value is neither null nor undefined, else None

Usage

import { fromNullable } from "common/src/index.ts";