nationid - v2.2.1
    Preparing search index...

    Function normalize

    • Strip separators and uppercase characters to produce the canonical storage form. Idempotent: calling normalize twice yields the same string.

      Use the normalized form as the database column value so equality lookups work regardless of how the user typed the document.

      Parameters

      • code: DocumentTypeCode

        Document type whose normalization rules apply.

      • input: string

        Raw user input.

      Returns string

      Canonical storage form (digits/uppercase, no separators).

      if code is not registered.

      normalize("BR_CNPJ", "12.345.678/0001-90"); // "12345678000190"
      normalize("MX_CURP", "gomc850315hdfrrr07"); // "GOMC850315HDFRRR07"