Documentation
    Preparing search index...

    Type Alias IValidation<T>

    Validation result type with detailed error information.

    IValidation<T> is the return type of typia.validate<T>() and related validation functions. Unlike typia.is<T>() which returns a boolean, or typia.assert<T>() which throws exceptions, typia.validate<T>() returns this structured result with full error details.

    Check the IValidation.success | success discriminator:

    This is the recommended validation function when you need to report validation errors to users or log them for debugging.

    Type Parameters

    • T = unknown

      The expected type after successful validation

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

    const result = typia.validate<User>(input);
    if (result.success) {
    return result.data; // User type
    } else {
    result.errors.forEach((e) => console.log(e.path, e.expected));
    }