How to use awesome-phonenumber - 5 common examples

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

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

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 2 months ago

Package Health Score

75 / 100
Full package analysis

Popular awesome-phonenumber functions