nationid - v2.2.1
    Preparing search index...

    Function validate

    • Validate a Chilean (CL) identity or tax document.

      Parameters

      • code: "CL_RUT" | "CL_PASAPORTE" | ShortCode

        Document type, either fully-qualified (CL_RUT, CL_PASAPORTE) or short (RUT, RUN, PASAPORTE).

      • input: string

        Raw document string (formatting tolerated).

      Returns boolean

      true if the value passes CL-specific validation rules.

      import { validate } from "nationid/cl";
      validate("CL_RUT", "12.345.678-5"); // true
      validate("RUN", "11111111-1");