Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "lib/telephones"

Index

Variables

Const mobilePhoneRegExP

mobilePhoneRegExP: RegExp = /^[67]\d{3}-\d{4}$/

Beginning with 6 or 7 follow by three digits, then a dash and ends with four digits only

Const residentialPhoneRegExP

residentialPhoneRegExP: RegExp = /^2\d{3}-\d{4}$/

Beginning with 2 follow by three digits, then a dash and ends with four digits only

Functions

isMobilePhoneNumber

  • isMobilePhoneNumber(phone: string): boolean
  • Verifies that given string number is a mobile number

    Parameters

    • phone: string

      A string phone number with a dash included

    Returns boolean

    Is a valid mobile phone number

isPhoneNumber

  • isPhoneNumber(phone: string): boolean
  • Verifies that given string number is a phone number

    Parameters

    • phone: string

      A string phone number with a dash included

    Returns boolean

    Is a valid phone number

isResidentialPhoneNumber

  • isResidentialPhoneNumber(phone: string): boolean
  • Verifies that given string number is a residential number

    Parameters

    • phone: string

      A string phone number with a dash included

    Returns boolean

    Is a valid residential phone number

Generated using TypeDoc