nationid - v2.2.1
    Preparing search index...

    Function validate

    • Validate a Danish (DK) identity, business or VAT document.

      Parameters

      • code: "DK_CPR" | "DK_CVR" | "DK_VAT" | ShortCode

        Document type, either fully-qualified (DK_CPR, DK_CVR, DK_VAT) or short (CPR, CVR, VAT, MOMS).

      • input: string

        Raw document string (formatting tolerated).

      Returns boolean

      true if the value passes DK-specific validation rules.

      import { validate } from "nationid/dk";
      validate("DK_CPR", "070761-4285"); // true
      validate("CVR", "13585628");