nationid - v2.2.1
    Preparing search index...

    Function validate

    • Validate a UK (GB) identity, tax, VAT or NHS document.

      Parameters

      • code: "GB_NINO" | "GB_UTR" | "GB_VAT" | "GB_NHS" | ShortCode

        Document type, either fully-qualified (GB_NINO, GB_UTR, GB_VAT, GB_NHS) or short (NINO, UTR, VAT, NHS).

      • input: string

        Raw document string (formatting tolerated).

      Returns boolean

      true if the value passes GB-specific validation rules.

      import { validate } from "nationid/gb";
      validate("GB_NINO", "QQ 12 34 56 C"); // true
      validate("VAT", "GB 123 4567 89");