• Converts into an array.

    Type Parameters

    • T

    Parameters

    • opt: Option<T>

      The optional value.

    Returns T[]

    The array which contains zero or one element.

    Examples

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

    assertEquals(toArray(some(2)), [2]);
    assertEquals(toArray(none()), []);

Generated using TypeDoc