lanka-validations - v2.1.0
    Preparing search index...

    Module phone

    Validate, parse, and format Sri Lankan phone numbers and short codes.

    Import from lanka-validations/phone, or from the package root.

    Recognises mobile, fixed-line, toll-free, and public short codes; formats to national, international, E.164, or tel: URIs; and reports the area and originally allocated operator.

    import { isValidMobile, formatPhone, parsePhone } from 'lanka-validations/phone';

    isValidMobile('077 123 4567'); // true
    formatPhone('0771234567', 'e164'); // '+94771234567'
    parsePhone('0112345678')?.areaName; // 'Colombo'
    formatPhone
    isValidContactPhone
    isValidLandline
    isValidMobile
    isValidPhone
    isValidShortCode
    normalizePhoneNumber
    parsePhone
    validatePhone
    AreaCodeInfo
    PhoneInfo
    ShortCodeInfo
    FixedOperator
    MobileOperator
    PhoneFormatStyle
    PhoneType
    AREA_CODES
    FIXED_OPERATOR_DIGITS
    MOBILE_PREFIXES
    SRI_LANKA_SHORT_CODES