• Checks whether the result is an Ok.

    Type Parameters

    • E

    • T

    Parameters

    • res: Result<E, T>

      The result to be checked.

    Returns res is Ok<T>

    Whether the result is an Ok.

    Examples

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

    assertEquals(isOk(ok(-3)), true);
    assertEquals(isOk(err("Some error message")), false);

Generated using TypeDoc