How to use the awesome-phonenumber function in awesome-phonenumber

To help you get started, we’ve selected a few awesome-phonenumber examples, based on popular ways it is used in public projects.

github terascope / teraslice / packages / ts-transforms / src / operations / lib / validations / isdn.ts View on Github external
validate(value: string) {
        if (!new PhoneValidator(`+${value}`).isValid()) return false;
        return true;
    }
}
github Burry / Sigmaker / src / components / Generator / Signature / Signature.js View on Github external
const phoneUri = value =>
        new PhoneNumber(value, dialCode).getNumber('rfc3966') || `tel:${value}`;
github Burry / Sigmaker / src / components / Generator / Generator.js View on Github external
const phoneNumber = value =>
        new PhoneNumber(value, inputs.dialCode.value).getNumber('national') ||
        value;
github mitodl / micromasters / static / js / lib / validation / profile.js View on Github external
    phoneNumber => new PhoneNumber(phoneNumber).isValid()
  ]
github terascope / teraslice / packages / ts-transforms / src / operations / lib / validations / isdn.ts View on Github external
normalize(data: any) {
        const phoneNumber = new PhoneValidator(`+${data}`);
        const fullNumber = phoneNumber.getNumber();
        if (fullNumber) return String(fullNumber).slice(1);
        throw Error('could not normalize');
    }

awesome-phonenumber

Google's libphonenumber pre-compiled with the closure compiler

MIT
Latest version published 3 days ago

Package Health Score

76 / 100
Full package analysis

Popular awesome-phonenumber functions

Similar packages