nationid - v2.2.1
    Preparing search index...

    Function validate

    • Validate a Portuguese (PT) identity or tax document.

      Parameters

      • code: "PT_NIF" | "PT_CC" | "PT_PASAPORTE" | ShortCode

        Document type, either fully-qualified (PT_NIF, PT_CC) or short (NIF, NIPC, CC, PASAPORTE).

      • input: string

        Raw document string (formatting tolerated).

      Returns boolean

      true if the value passes PT-specific validation rules.

      import { validate } from "nationid/pt";
      validate("PT_NIF", "123456789");
      validate("CC", "12345678 9 ZZ4");