• Creates a new Err instance representing a failed operation.

    Type Parameters

    • T

      The type that would have been returned if successful

    Parameters

    • error: string

      The error message describing what went wrong

    Returns Result<T>

    A Result containing the error message

    const result = JsonDecoder.err<number>("Invalid number");
    // result = Err("Invalid number")