nationid - v2.2.1
    Preparing search index...

    Function validate

    • Validate a Mexican (MX) identity or tax document.

      Parameters

      • code:
            | "MX_CURP"
            | "MX_RFC_PF"
            | "MX_RFC_PM"
            | "MX_CLAVE_ELECTOR"
            | "MX_NSS"
            | "MX_PASAPORTE"
            | ShortCode

        Document type, either fully-qualified (MX_CURP, MX_RFC_PF) or short (CURP, RFC_PF, RFC_PM, CLAVE_ELECTOR, INE, NSS, PASAPORTE).

      • input: string

        Raw document string (formatting tolerated).

      Returns boolean

      true if the value passes MX-specific validation rules.

      import { validate } from "nationid/mx";
      validate("MX_CURP", "HEGG560427MVZRRL04");
      validate("RFC_PF", "VECJ880326XXX");