UNPKG

nigerian-mobile-validator

Version:

The most rigorous, up-to-date library for validating Nigerian mobile numbers. Fully NCC-compliant, and security-focused, with enterprise-grade features to prevent the business risks of validation failures in regulated industries.

33 lines (32 loc) 1.31 kB
import { NetworkAccessCode } from './network-access-code'; import { MobileNumberRange } from './mobile-number-range'; import { Telco } from './telco'; /** * Represents a specific number range assigned to a mobile network operator * e.g. 08030000000-08039999999. */ export declare class TelcoNumberAllocation { readonly networkAccessCode: NetworkAccessCode; readonly telco: Telco; readonly localNumberRange: MobileNumberRange; /** * Create a TelcoNumberAllocation * * @param networkAccessCode The network access code (e.g. 803) * @param telco The telco operator (e.g. MTN) * @param subscriberNumberLowerbound Lower bound of subscriber numbers (without network code) * @param subscriberNumberUpperbound Upper bound of subscriber numbers (without network code) */ constructor(networkAccessCode: NetworkAccessCode, telco: Telco, { subscriberNumberLowerbound, subscriberNumberUpperbound }: { subscriberNumberLowerbound: number; subscriberNumberUpperbound: number; }); /** * Compare this allocation with another one for sorting */ compareTo(other: TelcoNumberAllocation): number; /** * Convert a subscriber number to a local number by adding the network code */ private subscriberNumberToLocalNumber; }