Documentation
    Preparing search index...

    Type Alias IResult<T, E>

    Result type for operations that can either succeed or fail.

    IResult is a discriminated union representing the outcome of an operation that may fail. This pattern (often called "Result" or "Either" monad) enables explicit error handling without exceptions.

    Check the IResult.success | success discriminator to determine the outcome:

    This pattern is used throughout typia for safe operations like parsing and transformation where errors are expected possibilities.

    Type Parameters

    • T

      Type of the success value

    • E

      Type of the error value

    Jeongho Nam - https://github.com/samchon

    const result: IResult<User, ParseError> = parseUser(json);
    if (result.success) {
    console.log(result.value.name);
    } else {
    console.error(result.error.message);
    }