nationid - v2.2.1
    Preparing search index...

    Type Alias ParseResult<C>

    ParseResult:
        | {
            code: C;
            confidence: Confidence;
            formatted: string;
            normalized: string;
            ok: true;
        }
        | { code: C; ok: false; reason: ParseError }

    Discriminated union returned by parse().

    Parametrized over the document type code so the public root parse<C>(code, input) can narrow result.code to the exact C the caller passed in (instead of the whole DocumentTypeCode union). The default C = DocumentTypeCode keeps unparametrized references (ParseResult with no type argument) backwards compatible — they behave exactly as they did pre-v1.0.

    No exceptions are thrown from public API.

    Type Parameters