nationid - v2.2.1
    Preparing search index...

    Function validate

    • Validate a Colombian (CO) identity or tax document.

      Parameters

      • code:
            | "CO_CC"
            | "CO_CE"
            | "CO_TI"
            | "CO_PASAPORTE"
            | "CO_NIT"
            | "CO_PEP"
            | "CO_PPT"
            | ShortCode

        Document type, either fully-qualified (CO_CC, CO_NIT, ...) or short (CC, CE, TI, PASAPORTE, NIT, PEP, PPT).

      • input: string

        Raw document string (formatting tolerated).

      Returns boolean

      true if the value passes CO-specific validation rules.

      import { validate } from "nationid/co";
      validate("CO_CC", "1.020.304.050"); // true
      validate("NIT", "900.123.456-1");