nationid - v2.2.1
    Preparing search index...

    Function validate

    • Validate a Canadian (CA) identity or business document.

      Accepts fully-qualified codes (CA_SIN, CA_BN, CA_PASAPORTE) and short forms SIN, NAS (French alias for SIN), BN, PASAPORTE / PASSPORT.

      Parameters

      • code: "CA_SIN" | "CA_BN" | "CA_PASAPORTE" | ShortCode

        CA document type or short alias.

      • input: string

        Raw document string (formatting tolerated).

      Returns boolean

      true if the value passes CA-specific validation rules.

      import { validate } from "nationid/ca";
      validate("CA_SIN", "046 454 286"); // true
      validate("BN", "123456789RT0001");