nationid - v2.2.1
    Preparing search index...

    Function validate

    • Validate a United States (US) identity or tax document.

      Parameters

      • code: "US_SSN" | "US_ITIN" | "US_EIN" | "US_PASAPORTE" | ShortCode

        Document type, either fully-qualified (US_SSN, US_ITIN, US_EIN) or short (SSN, ITIN, EIN, PASSPORT).

      • input: string

        Raw document string (formatting tolerated).

      Returns boolean

      true if the value passes US-specific validation rules.

      import { validate } from "nationid/us";
      validate("US_SSN", "123-45-6789");
      validate("EIN", "12-3456789");