Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "lib/documents"

Index

Variables

Const carPlateRegExp

carPlateRegExp: RegExp = /^(O|N|CD|CC|P|A|C|V|PR|T|RE|AB|MI|MB|F|M|D|PNC|E)\d{1,6}$/i

Const duiRegExp

duiRegExp: RegExp = /(^\d{8})-(\d$)/

Const nitRegExp

nitRegExp: RegExp = /((^\d{4})-(\d{6})-(\d{3})-(\d$))|(^\d{14}$)/

Const passportRegExp

passportRegExp: RegExp = /^[a-zA-Z]\d{8}$/

Functions

calculateNitVerification

  • calculateNitVerification(digits: string): number
  • Calculates verification value for a given NIT

    Parameters

    • digits: string

      A string representing NIT digits (without hyphen and verifier)

    Returns number

    Verification value for a given NIT

calculateNitVerificationOldFormat

  • calculateNitVerificationOldFormat(digits: string): number
  • Calculates verification value for a given old format NIT

    Parameters

    • digits: string

      A string representing NIT digits (without hyphen and verifier)

    Returns number

    Verification value for a given old format NIT

isCarPlate

  • isCarPlate(str: string): boolean
  • Verifies that given car plate is valid

    Parameters

    • str: string

      A string representing a car plate

    Returns boolean

    Validity of the given Car Plate

isDUI

  • isDUI(str: string): boolean
  • Verifies that given DUI format is valid

    Parameters

    • str: string

      A string representing DUI digits (with hyphen)

    Returns boolean

    Validity of the given DUI

isNIT

  • isNIT(str: string): boolean
  • Verifies that given NIT format is valid

    Parameters

    • str: string

      A string representing NIT digits

    Returns boolean

    Validity of the given NIT

isPassport

  • isPassport(str: string): boolean
  • Verifies that given Passport format is valid

    Parameters

    • str: string

      A string representing the passport

    Returns boolean

    Validity of the given passport

splitNIT

  • splitNIT(str: string): string[]
  • Parameters

    • str: string

      A string representing NIT digits (with hyphen)

    Returns string[]

    NIT compounds

Generated using TypeDoc