Staquia API
    Preparing search index...

    Class Ok<T>

    A successful Result, with its value.

    import { Ok } from "staquia";

    const result = new Ok(5);
    console.log(result.ok, result.value); // true 5

    Type Parameters

    • T

      The type of the value.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    • Creates an instance of an Ok result.

      Type Parameters

      • T

        The type of the value.

      Parameters

      • Optionalvalue: T

        The value to wrap, optional if T permits void/undefined.

      Returns Ok<T>

    Accessors

    • get ok(): true

      Indicates that the result is successful.

      Returns true

    • get value(): T

      The successful value contained within this result.

      Returns T

    Methods

    • Returns a string representation of the contained value.

      Returns string