UNPKG

1.22 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../source/formatIncompletePhoneNumber.js"],"names":["formatIncompletePhoneNumber","value","country","metadata","undefined","AsYouType","input"],"mappings":";;;;;;;AAAA;;;;AAEA;;;;;;;;AAQe,SAASA,2BAAT,CAAqCC,KAArC,EAA4CC,OAA5C,EAAqDC,QAArD,EAA+D;AAC7E,MAAI,CAACA,QAAL,EAAe;AACdA,IAAAA,QAAQ,GAAGD,OAAX;AACAA,IAAAA,OAAO,GAAGE,SAAV;AACA;;AACD,SAAO,IAAIC,qBAAJ,CAAcH,OAAd,EAAuBC,QAAvB,EAAiCG,KAAjC,CAAuCL,KAAvC,CAAP;AACA","sourcesContent":["import AsYouType from './AsYouType'\r\n\r\n/**\r\n * Formats a (possibly incomplete) phone number.\r\n * The phone number can be either in E.164 format\r\n * or in a form of national number digits.\r\n * @param {string} value - A possibly incomplete phone number. Either in E.164 format or in a form of national number digits.\r\n * @param {string?} country - Two-letter (\"ISO 3166-1 alpha-2\") country code.\r\n * @return {string} Formatted (possibly incomplete) phone number.\r\n */\r\nexport default function formatIncompletePhoneNumber(value, country, metadata) {\r\n\tif (!metadata) {\r\n\t\tmetadata = country\r\n\t\tcountry = undefined\r\n\t}\r\n\treturn new AsYouType(country, metadata).input(value)\r\n}"],"file":"formatIncompletePhoneNumber.js"}
\No newline at end of file