• Converts into an array.

    Type Parameters

    • E

    • T

    Parameters

    Returns T[]

    The array which contains zero or one success element.

    Examples

    import { err, ok, toArray } from "./result.ts";
    import { assertEquals } from "../deps.ts";

    assertEquals(toArray(ok(24)), [24]);
    assertEquals(toArray(err("hoge")), []);

Generated using TypeDoc