@illavv/run_typer - v4.1.0
    Preparing search index...

    Type Alias ParseResult<T>

    ParseResult:
        | { data: T; success: true }
        | { error: TypeError; issues: ValidationIssue[]; success: false }

    Result returned by safeParse: a discriminated union with either the validated value or the encountered error.

    On failure, prefer issues over error: it is structured, and reading it does not force the (comparatively expensive) construction of an Error with its stack trace, which error performs lazily on first access.

    Type Parameters

    • T

      The validated value type on success

    Type Declaration

    • { data: T; success: true }
    • { error: TypeError; issues: ValidationIssue[]; success: false }
      • Readonlyerror: TypeError

        The equivalent thrown error. Built on first access and then cached — a TyperError, which extends TypeError.

      • issues: ValidationIssue[]

        Every problem found, in schema order. Structured and cheap to read.

      • success: false