UNPKG

libphonenumber-js

Version:

A simpler (and smaller) rewrite of Google Android's popular libphonenumber library

14 lines (13 loc) 658 B
import AsYouType from './AsYouType'; /** * Formats a (possibly incomplete) phone number. * The phone number can be either in E.164 format * or in a form of national number digits. * @param {string} value - A possibly incomplete phone number. Either in E.164 format or in a form of national number digits. * @param {string?} country - Two-letter ("ISO 3166-1 alpha-2") country code. * @return {string} Formatted (possibly incomplete) phone number. */ export default function formatIncompletePhoneNumber(value, country, metadata) { return new AsYouType(country, metadata).input(value); } //# sourceMappingURL=formatIncompletePhoneNumber.js.map