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.

29 lines (28 loc) 1.12 kB
/** * Represents a range of NCC-assigned numbers. * * This class does not know whether it is storing the subscriber number part * or the local number part. In fact, all it knows is that it stores an ordered * set of 2 integers. * * NOTE: By definition the "local number" begins with the network access code (e.g. 08031234567) * while the "subscriber number" part does not include the access code (e.g. 1234567). */ export declare class MobileNumberRange { readonly lowerBound: number; readonly upperBound: number; constructor(lowerBound: number, upperBound: number); /** * Checks whether the given MobileNumberRange is a subset of this object. */ isSubset(otherMobileNumberRange: MobileNumberRange): boolean; /** * Checks whether the given number lies within the lower and upperbounds of this object. */ isWithinRange(usersNumber: number): boolean; /** * Compares this range with another range. * Returns -1 if this range comes before, 1 if it comes after, 0 if they overlap. */ compareTo(otherMobileNumberRange: MobileNumberRange): number; }