UNPKG

react-phonenumber-text-input

Version:

an international phone number input component for React.

3 lines (2 loc) 845 B
"use strict";var t=require("./useMemoizedFn.js"),r=require("../normalizeArguments-c4d84f74.js");function e(){var t=r.normalizeArguments(arguments),e=t.text,n=t.options,a=t.metadata;return r.parsePhoneNumberWithError(e,n,a)}function n(){return r.withMetadataArgument(e,arguments)}require("react"),exports.useParsePhoneNumberLibPhoneNumber=function(){return t((function(t,e){if(t.startsWith("+")){var a=n(t);return{countyCallingCode:a.countryCallingCode,countryCode:a.country||e,nationalNumber:a.nationalNumber,formattedNationalNumber:a.formatNational()}}var o=n("+"+function(){return r.withMetadataArgument(r.getCountryCallingCode,arguments)}(e)+t);return{countyCallingCode:o.countryCallingCode,countryCode:o.country||e,nationalNumber:o.nationalNumber,formattedNationalNumber:o.formatNational()}}))}; //# sourceMappingURL=parsePhoneNumber.js.map