@telefonica/libphonenumber
TypeScript icon, indicating that this package has built-in type declarations

2.9.0 • Public • Published

libphonenumber js wrapper

Wrapper around a custom compilation of Google's libphonenumber.

  • Compiled using ADVANCED_OPTIMIZATIONS to obtain the smallest possible library
  • Only the needed features should be exposed. This way the compiler can effectively remove unused code

API

formatAsYouType(number: string, viewerRegionCode: string): string;
formatToE164(phone: PhoneNumber): string;
formatToInternational(phone: PhoneNumber): string;
formatToNational(phone: PhoneNumber): string;
formatToNationalNumberWithCarrierCode(phoneNumber: PhoneNumber, carrierCode: string): string;
formatToPrint(phone: PhoneNumber, viewerRegionCode: string): string;
getPhoneNumberType(number: string, regionCode: string): string;
getRegionCodeForNumber(number: string, defaultRegionCode: string): string;
getRegionCodeForCountryCode(countryCode: string): string;
getPhoneDestinationTypeForNumber(number: string, defaultRegionCode: string): string;
isMobile(phone: PhoneNumber): boolean;
isMobileOrFixedLine(phone: PhoneNumber): boolean;
isShort(phone: PhoneNumber): boolean;
isValidNumber(phone: PhoneNumber): boolean;
parse(number: string, regionCode: string): PhoneNumber;

Install

yarn add @telefonica/libphonenumber

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i @telefonica/libphonenumber

    Weekly Downloads

    1,581

    Version

    2.9.0

    License

    Apache-2.0

    Unpacked Size

    275 kB

    Total Files

    7

    Last publish

    Collaborators

    • tdaf
    • aura
    • living-apps
    • lifecyle-novum