• Unzips the optional of tuple into the tuple of optionals.

    Type Parameters

    • T

    • U

    Parameters

    • opt: Option<[T, U]>

      The zipped optional of tuple.

    Returns [Option<T>, Option<U>]

    The unzipped tuple of optionals.

    Examples

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

    assertEquals(unzip(some([1, "hi"])), [
    some(1),
    some("hi"),
    ]);
    assertEquals(unzip(none()), [
    none(),
    none(),
    ]);

Generated using TypeDoc