• Flattens the nested optional.

    Type Parameters

    • T

    Parameters

    Returns Option<T>

    The flattened optional.

    Examples

    import { flatten, some, none } from "./option.ts";
    import { assertEquals } from "../deps.ts";

    assertEquals(flatten(some(some(6))), some(6));
    assertEquals(flatten(some(none())), none());
    assertEquals(flatten(none()), none());

Generated using TypeDoc