libphonenumber-js 1.13.7 → 1.13.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +50 -50
- package/AUTHORS +4 -4
- package/CHANGELOG.md +984 -971
- package/CODE_OF_CONDUCT.md +78 -78
- package/LICENSE +21 -21
- package/LICENSE.Apache +175 -175
- package/README.md +2110 -2110
- package/build/AsYouType.js +70 -70
- package/build/AsYouType.js.map +1 -1
- package/build/AsYouType.test.js.map +1 -1
- package/build/AsYouTypeFormatter.PatternMatcher.js +6 -6
- package/build/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
- package/build/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -1
- package/build/AsYouTypeFormatter.PatternParser.js.map +1 -1
- package/build/AsYouTypeFormatter.PatternParser.test.js.map +1 -1
- package/build/AsYouTypeFormatter.complete.js.map +1 -1
- package/build/AsYouTypeFormatter.js +11 -11
- package/build/AsYouTypeFormatter.js.map +1 -1
- package/build/AsYouTypeFormatter.util.js.map +1 -1
- package/build/AsYouTypeFormatter.util.test.js.map +1 -1
- package/build/AsYouTypeParser.js +26 -26
- package/build/AsYouTypeParser.js.map +1 -1
- package/build/AsYouTypeState.js +6 -6
- package/build/AsYouTypeState.js.map +1 -1
- package/build/ParseError.js.map +1 -1
- package/build/PhoneNumber.js +5 -5
- package/build/PhoneNumber.js.map +1 -1
- package/build/PhoneNumber.test.js.map +1 -1
- package/build/PhoneNumberMatcher.js +60 -60
- package/build/PhoneNumberMatcher.js.map +1 -1
- package/build/PhoneNumberMatcher.test.js.map +1 -1
- package/build/constants.js.map +1 -1
- package/build/findNumbers/LRUCache.js.map +1 -1
- package/build/findNumbers/Leniency.js +34 -34
- package/build/findNumbers/Leniency.js.map +1 -1
- package/build/findNumbers/RegExpCache.js.map +1 -1
- package/build/findNumbers/isValidCandidate.js +14 -14
- package/build/findNumbers/isValidCandidate.js.map +1 -1
- package/build/findNumbers/isValidPreCandidate.js.map +1 -1
- package/build/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +6 -6
- package/build/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js.map +1 -1
- package/build/findNumbers/parsePreCandidate.js.map +1 -1
- package/build/findNumbers/utf-8.js +19 -19
- package/build/findNumbers/utf-8.js.map +1 -1
- package/build/findNumbers/util.js +3 -3
- package/build/findNumbers/util.js.map +1 -1
- package/build/findNumbers/util.test.js.map +1 -1
- package/build/findPhoneNumbersInText.js.map +1 -1
- package/build/findPhoneNumbersInText.test.js.map +1 -1
- package/build/format.js +14 -14
- package/build/format.js.map +1 -1
- package/build/format.test.js.map +1 -1
- package/build/formatIncompletePhoneNumber.js +7 -7
- package/build/formatIncompletePhoneNumber.js.map +1 -1
- package/build/formatIncompletePhoneNumber.test.js.map +1 -1
- package/build/formatPhoneNumberForMobileDialing.js +35 -35
- package/build/formatPhoneNumberForMobileDialing.js.map +1 -1
- package/build/getCountries.js.map +1 -1
- package/build/getCountries.test.js.map +1 -1
- package/build/getCountryCallingCode.js.map +1 -1
- package/build/getCountryCallingCode.test.js.map +1 -1
- package/build/getExampleNumber.js.map +1 -1
- package/build/getExampleNumber.test.js.map +1 -1
- package/build/helpers/RFC3966.js +6 -6
- package/build/helpers/RFC3966.js.map +1 -1
- package/build/helpers/RFC3966.test.js.map +1 -1
- package/build/helpers/applyInternationalSeparatorStyle.js.map +1 -1
- package/build/helpers/applyInternationalSeparatorStyle.test.js.map +1 -1
- package/build/helpers/checkNumberLength.js +15 -15
- package/build/helpers/checkNumberLength.js.map +1 -1
- package/build/helpers/checkNumberLength.test.js.map +1 -1
- package/build/helpers/extension/createExtensionPattern.js +10 -10
- package/build/helpers/extension/createExtensionPattern.js.map +1 -1
- package/build/helpers/extension/extractExtension.js.map +1 -1
- package/build/helpers/extractCountryCallingCode.js +23 -23
- package/build/helpers/extractCountryCallingCode.js.map +1 -1
- package/build/helpers/extractCountryCallingCode.test.js.map +1 -1
- package/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +9 -9
- package/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
- package/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.test.js.map +1 -1
- package/build/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +4 -4
- package/build/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
- package/build/helpers/extractNationalNumber.js +15 -15
- package/build/helpers/extractNationalNumber.js.map +1 -1
- package/build/helpers/extractNationalNumber.test.js.map +1 -1
- package/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +12 -12
- package/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
- package/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.test.js.map +1 -1
- package/build/helpers/extractPhoneContext.js +17 -17
- package/build/helpers/extractPhoneContext.js.map +1 -1
- package/build/helpers/extractPhoneContext.test.js.map +1 -1
- package/build/helpers/formatNationalNumberUsingFormat.js.map +1 -1
- package/build/helpers/getCountryAndCallingCodeFromOneOfThem.js.map +1 -1
- package/build/helpers/getCountryByCallingCode.js +7 -7
- package/build/helpers/getCountryByCallingCode.js.map +1 -1
- package/build/helpers/getCountryByNationalNumber.js +7 -7
- package/build/helpers/getCountryByNationalNumber.js.map +1 -1
- package/build/helpers/getIddPrefix.js +8 -8
- package/build/helpers/getIddPrefix.js.map +1 -1
- package/build/helpers/getNumberType.js.map +1 -1
- package/build/helpers/getNumberType.test.js.map +1 -1
- package/build/helpers/getPossibleCountriesForNumber.js +6 -6
- package/build/helpers/getPossibleCountriesForNumber.js.map +1 -1
- package/build/helpers/isCallingCode.js.map +1 -1
- package/build/helpers/isCallingCode.test.js.map +1 -1
- package/build/helpers/isCountryCode.js.map +1 -1
- package/build/helpers/isCountryCode.test.js.map +1 -1
- package/build/helpers/isObject.js.map +1 -1
- package/build/helpers/isViablePhoneNumber.js.map +1 -1
- package/build/helpers/matchesEntirely.js +4 -4
- package/build/helpers/matchesEntirely.js.map +1 -1
- package/build/helpers/matchesEntirely.test.js.map +1 -1
- package/build/helpers/mergeArrays.js +5 -5
- package/build/helpers/mergeArrays.js.map +1 -1
- package/build/helpers/mergeArrays.test.js.map +1 -1
- package/build/helpers/parseDigits.js +12 -12
- package/build/helpers/parseDigits.js.map +1 -1
- package/build/helpers/parseDigits.test.js.map +1 -1
- package/build/helpers/stripIddPrefix.js.map +1 -1
- package/build/helpers/stripIddPrefix.test.js.map +1 -1
- package/build/isPossible.js +17 -17
- package/build/isPossible.js.map +1 -1
- package/build/isPossible.test.js.map +1 -1
- package/build/isPossiblePhoneNumber.js.map +1 -1
- package/build/isPossiblePhoneNumber.test.js.map +1 -1
- package/build/isValid.js +33 -33
- package/build/isValid.js.map +1 -1
- package/build/isValid.test.js.map +1 -1
- package/build/isValidPhoneNumber.js.map +1 -1
- package/build/isValidPhoneNumber.test.js.map +1 -1
- package/build/legacy/PhoneNumberSearch.js +4 -4
- package/build/legacy/PhoneNumberSearch.js.map +1 -1
- package/build/legacy/findNumbers.js.map +1 -1
- package/build/legacy/findNumbers.test.js.map +1 -1
- package/build/legacy/findPhoneNumbers.js +2 -2
- package/build/legacy/findPhoneNumbers.js.map +1 -1
- package/build/legacy/findPhoneNumbers.test.js.map +1 -1
- package/build/legacy/findPhoneNumbersInitialImplementation.js +16 -16
- package/build/legacy/findPhoneNumbersInitialImplementation.js.map +1 -1
- package/build/legacy/format.js.map +1 -1
- package/build/legacy/format.test.js.map +1 -1
- package/build/legacy/getNumberType.js.map +1 -1
- package/build/legacy/getNumberType.test.js.map +1 -1
- package/build/legacy/isPossibleNumber.js +13 -13
- package/build/legacy/isPossibleNumber.js.map +1 -1
- package/build/legacy/isPossibleNumber.test.js.map +1 -1
- package/build/legacy/isValidNumber.js.map +1 -1
- package/build/legacy/isValidNumber.test.js.map +1 -1
- package/build/legacy/isValidNumberForRegion.js.map +1 -1
- package/build/legacy/isValidNumberForRegion.test.js.map +1 -1
- package/build/legacy/isValidNumberForRegion_.js +4 -4
- package/build/legacy/isValidNumberForRegion_.js.map +1 -1
- package/build/legacy/parse.js.map +1 -1
- package/build/legacy/parse.test.js.map +1 -1
- package/build/legacy/searchNumbers.js +2 -2
- package/build/legacy/searchNumbers.js.map +1 -1
- package/build/legacy/searchNumbers.test.js.map +1 -1
- package/build/metadata.js +40 -40
- package/build/metadata.js.map +1 -1
- package/build/metadata.test.js.map +1 -1
- package/build/normalizeArguments.js.map +1 -1
- package/build/parse.js +36 -36
- package/build/parse.js.map +1 -1
- package/build/parse.test.js.map +1 -1
- package/build/parseIncompletePhoneNumber.js +24 -24
- package/build/parseIncompletePhoneNumber.js.map +1 -1
- package/build/parseIncompletePhoneNumber.test.js.map +1 -1
- package/build/parsePhoneNumber.js.map +1 -1
- package/build/parsePhoneNumber.test.js.map +1 -1
- package/build/parsePhoneNumberWithError.js.map +1 -1
- package/build/parsePhoneNumberWithError.test.js.map +1 -1
- package/build/parsePhoneNumberWithError_.js.map +1 -1
- package/build/parsePhoneNumber_.js.map +1 -1
- package/build/searchPhoneNumbersInText.js.map +1 -1
- package/build/searchPhoneNumbersInText.test.js.map +1 -1
- package/build/tools/semver-compare.js.map +1 -1
- package/build/tools/semver-compare.test.js.map +1 -1
- package/build/validatePhoneNumberLength.js.map +1 -1
- package/build/validatePhoneNumberLength.test.js.map +1 -1
- package/bundle/libphonenumber-js.min.js +1 -1
- package/bundle/libphonenumber-js.min.js.map +1 -1
- package/bundle/libphonenumber-max.js +1 -1
- package/bundle/libphonenumber-max.js.map +1 -1
- package/bundle/libphonenumber-min.js +1 -1
- package/bundle/libphonenumber-min.js.map +1 -1
- package/bundle/libphonenumber-mobile.js +1 -1
- package/bundle/libphonenumber-mobile.js.map +1 -1
- package/core/es6/index.d.cts +2 -2
- package/core/es6/index.d.ts +2 -2
- package/core/es6/index.js +39 -39
- package/core/es6/package.json +12 -12
- package/core/index.cjs +57 -57
- package/core/index.cjs.js +62 -62
- package/core/index.d.cts +150 -150
- package/core/index.d.ts +150 -150
- package/core/index.js +39 -39
- package/core/package.json +14 -14
- package/custom.d.ts +209 -209
- package/custom.js +78 -78
- package/es6/AsYouType.js +70 -70
- package/es6/AsYouType.js.map +1 -1
- package/es6/AsYouType.test.js.map +1 -1
- package/es6/AsYouTypeFormatter.PatternMatcher.js +6 -6
- package/es6/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
- package/es6/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -1
- package/es6/AsYouTypeFormatter.PatternParser.js.map +1 -1
- package/es6/AsYouTypeFormatter.PatternParser.test.js.map +1 -1
- package/es6/AsYouTypeFormatter.complete.js.map +1 -1
- package/es6/AsYouTypeFormatter.js +11 -11
- package/es6/AsYouTypeFormatter.js.map +1 -1
- package/es6/AsYouTypeFormatter.util.js.map +1 -1
- package/es6/AsYouTypeFormatter.util.test.js.map +1 -1
- package/es6/AsYouTypeParser.js +26 -26
- package/es6/AsYouTypeParser.js.map +1 -1
- package/es6/AsYouTypeState.js +6 -6
- package/es6/AsYouTypeState.js.map +1 -1
- package/es6/ParseError.js.map +1 -1
- package/es6/PhoneNumber.js +5 -5
- package/es6/PhoneNumber.js.map +1 -1
- package/es6/PhoneNumber.test.js.map +1 -1
- package/es6/PhoneNumberMatcher.js +60 -60
- package/es6/PhoneNumberMatcher.js.map +1 -1
- package/es6/PhoneNumberMatcher.test.js.map +1 -1
- package/es6/constants.js.map +1 -1
- package/es6/findNumbers/LRUCache.js.map +1 -1
- package/es6/findNumbers/Leniency.js +34 -34
- package/es6/findNumbers/Leniency.js.map +1 -1
- package/es6/findNumbers/RegExpCache.js.map +1 -1
- package/es6/findNumbers/isValidCandidate.js +14 -14
- package/es6/findNumbers/isValidCandidate.js.map +1 -1
- package/es6/findNumbers/isValidPreCandidate.js.map +1 -1
- package/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +6 -6
- package/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js.map +1 -1
- package/es6/findNumbers/parsePreCandidate.js.map +1 -1
- package/es6/findNumbers/utf-8.js +19 -19
- package/es6/findNumbers/utf-8.js.map +1 -1
- package/es6/findNumbers/util.js +3 -3
- package/es6/findNumbers/util.js.map +1 -1
- package/es6/findNumbers/util.test.js.map +1 -1
- package/es6/findPhoneNumbersInText.js.map +1 -1
- package/es6/findPhoneNumbersInText.test.js.map +1 -1
- package/es6/format.js +14 -14
- package/es6/format.js.map +1 -1
- package/es6/format.test.js.map +1 -1
- package/es6/formatIncompletePhoneNumber.js +7 -7
- package/es6/formatIncompletePhoneNumber.js.map +1 -1
- package/es6/formatIncompletePhoneNumber.test.js.map +1 -1
- package/es6/formatPhoneNumberForMobileDialing.js +35 -35
- package/es6/formatPhoneNumberForMobileDialing.js.map +1 -1
- package/es6/getCountries.js.map +1 -1
- package/es6/getCountries.test.js.map +1 -1
- package/es6/getCountryCallingCode.js.map +1 -1
- package/es6/getCountryCallingCode.test.js.map +1 -1
- package/es6/getExampleNumber.js.map +1 -1
- package/es6/getExampleNumber.test.js.map +1 -1
- package/es6/helpers/RFC3966.js +6 -6
- package/es6/helpers/RFC3966.js.map +1 -1
- package/es6/helpers/RFC3966.test.js.map +1 -1
- package/es6/helpers/applyInternationalSeparatorStyle.js.map +1 -1
- package/es6/helpers/applyInternationalSeparatorStyle.test.js.map +1 -1
- package/es6/helpers/checkNumberLength.js +15 -15
- package/es6/helpers/checkNumberLength.js.map +1 -1
- package/es6/helpers/checkNumberLength.test.js.map +1 -1
- package/es6/helpers/extension/createExtensionPattern.js +10 -10
- package/es6/helpers/extension/createExtensionPattern.js.map +1 -1
- package/es6/helpers/extension/extractExtension.js.map +1 -1
- package/es6/helpers/extractCountryCallingCode.js +23 -23
- package/es6/helpers/extractCountryCallingCode.js.map +1 -1
- package/es6/helpers/extractCountryCallingCode.test.js.map +1 -1
- package/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +9 -9
- package/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
- package/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.test.js.map +1 -1
- package/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +4 -4
- package/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
- package/es6/helpers/extractNationalNumber.js +15 -15
- package/es6/helpers/extractNationalNumber.js.map +1 -1
- package/es6/helpers/extractNationalNumber.test.js.map +1 -1
- package/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +12 -12
- package/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
- package/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.test.js.map +1 -1
- package/es6/helpers/extractPhoneContext.js +17 -17
- package/es6/helpers/extractPhoneContext.js.map +1 -1
- package/es6/helpers/extractPhoneContext.test.js.map +1 -1
- package/es6/helpers/formatNationalNumberUsingFormat.js.map +1 -1
- package/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js.map +1 -1
- package/es6/helpers/getCountryByCallingCode.js +7 -7
- package/es6/helpers/getCountryByCallingCode.js.map +1 -1
- package/es6/helpers/getCountryByNationalNumber.js +7 -7
- package/es6/helpers/getCountryByNationalNumber.js.map +1 -1
- package/es6/helpers/getIddPrefix.js +8 -8
- package/es6/helpers/getIddPrefix.js.map +1 -1
- package/es6/helpers/getNumberType.js.map +1 -1
- package/es6/helpers/getNumberType.test.js.map +1 -1
- package/es6/helpers/getPossibleCountriesForNumber.js +6 -6
- package/es6/helpers/getPossibleCountriesForNumber.js.map +1 -1
- package/es6/helpers/isCallingCode.js.map +1 -1
- package/es6/helpers/isCallingCode.test.js.map +1 -1
- package/es6/helpers/isCountryCode.js.map +1 -1
- package/es6/helpers/isCountryCode.test.js.map +1 -1
- package/es6/helpers/isObject.js.map +1 -1
- package/es6/helpers/isViablePhoneNumber.js.map +1 -1
- package/es6/helpers/matchesEntirely.js +4 -4
- package/es6/helpers/matchesEntirely.js.map +1 -1
- package/es6/helpers/matchesEntirely.test.js.map +1 -1
- package/es6/helpers/mergeArrays.js +5 -5
- package/es6/helpers/mergeArrays.js.map +1 -1
- package/es6/helpers/mergeArrays.test.js.map +1 -1
- package/es6/helpers/parseDigits.js +12 -12
- package/es6/helpers/parseDigits.js.map +1 -1
- package/es6/helpers/parseDigits.test.js.map +1 -1
- package/es6/helpers/stripIddPrefix.js.map +1 -1
- package/es6/helpers/stripIddPrefix.test.js.map +1 -1
- package/es6/isPossible.js +17 -17
- package/es6/isPossible.js.map +1 -1
- package/es6/isPossible.test.js.map +1 -1
- package/es6/isPossiblePhoneNumber.js.map +1 -1
- package/es6/isPossiblePhoneNumber.test.js.map +1 -1
- package/es6/isValid.js +33 -33
- package/es6/isValid.js.map +1 -1
- package/es6/isValid.test.js.map +1 -1
- package/es6/isValidPhoneNumber.js.map +1 -1
- package/es6/isValidPhoneNumber.test.js.map +1 -1
- package/es6/legacy/PhoneNumberSearch.js +4 -4
- package/es6/legacy/PhoneNumberSearch.js.map +1 -1
- package/es6/legacy/findNumbers.js.map +1 -1
- package/es6/legacy/findNumbers.test.js.map +1 -1
- package/es6/legacy/findPhoneNumbers.js +2 -2
- package/es6/legacy/findPhoneNumbers.js.map +1 -1
- package/es6/legacy/findPhoneNumbers.test.js.map +1 -1
- package/es6/legacy/findPhoneNumbersInitialImplementation.js +16 -16
- package/es6/legacy/findPhoneNumbersInitialImplementation.js.map +1 -1
- package/es6/legacy/format.js.map +1 -1
- package/es6/legacy/format.test.js.map +1 -1
- package/es6/legacy/getNumberType.js.map +1 -1
- package/es6/legacy/getNumberType.test.js.map +1 -1
- package/es6/legacy/isPossibleNumber.js +13 -13
- package/es6/legacy/isPossibleNumber.js.map +1 -1
- package/es6/legacy/isPossibleNumber.test.js.map +1 -1
- package/es6/legacy/isValidNumber.js.map +1 -1
- package/es6/legacy/isValidNumber.test.js.map +1 -1
- package/es6/legacy/isValidNumberForRegion.js.map +1 -1
- package/es6/legacy/isValidNumberForRegion.test.js.map +1 -1
- package/es6/legacy/isValidNumberForRegion_.js +4 -4
- package/es6/legacy/isValidNumberForRegion_.js.map +1 -1
- package/es6/legacy/parse.js.map +1 -1
- package/es6/legacy/parse.test.js.map +1 -1
- package/es6/legacy/searchNumbers.js +2 -2
- package/es6/legacy/searchNumbers.js.map +1 -1
- package/es6/legacy/searchNumbers.test.js.map +1 -1
- package/es6/metadata.js +40 -40
- package/es6/metadata.js.map +1 -1
- package/es6/metadata.test.js.map +1 -1
- package/es6/normalizeArguments.js.map +1 -1
- package/es6/parse.js +36 -36
- package/es6/parse.js.map +1 -1
- package/es6/parse.test.js.map +1 -1
- package/es6/parseIncompletePhoneNumber.js +24 -24
- package/es6/parseIncompletePhoneNumber.js.map +1 -1
- package/es6/parseIncompletePhoneNumber.test.js.map +1 -1
- package/es6/parsePhoneNumber.js.map +1 -1
- package/es6/parsePhoneNumber.test.js.map +1 -1
- package/es6/parsePhoneNumberWithError.js.map +1 -1
- package/es6/parsePhoneNumberWithError.test.js.map +1 -1
- package/es6/parsePhoneNumberWithError_.js.map +1 -1
- package/es6/parsePhoneNumber_.js.map +1 -1
- package/es6/searchPhoneNumbersInText.js.map +1 -1
- package/es6/searchPhoneNumbersInText.test.js.map +1 -1
- package/es6/tools/semver-compare.js.map +1 -1
- package/es6/tools/semver-compare.test.js.map +1 -1
- package/es6/validatePhoneNumberLength.js.map +1 -1
- package/es6/validatePhoneNumberLength.test.js.map +1 -1
- package/es6-modern/AsYouType.js +70 -70
- package/es6-modern/AsYouType.js.map +1 -1
- package/es6-modern/AsYouType.test.js.map +1 -1
- package/es6-modern/AsYouTypeFormatter.PatternMatcher.js +6 -6
- package/es6-modern/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
- package/es6-modern/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -1
- package/es6-modern/AsYouTypeFormatter.PatternParser.js.map +1 -1
- package/es6-modern/AsYouTypeFormatter.PatternParser.test.js.map +1 -1
- package/es6-modern/AsYouTypeFormatter.complete.js.map +1 -1
- package/es6-modern/AsYouTypeFormatter.js +11 -11
- package/es6-modern/AsYouTypeFormatter.js.map +1 -1
- package/es6-modern/AsYouTypeFormatter.util.js.map +1 -1
- package/es6-modern/AsYouTypeFormatter.util.test.js.map +1 -1
- package/es6-modern/AsYouTypeParser.js +26 -26
- package/es6-modern/AsYouTypeParser.js.map +1 -1
- package/es6-modern/AsYouTypeState.js +6 -6
- package/es6-modern/AsYouTypeState.js.map +1 -1
- package/es6-modern/ParseError.js.map +1 -1
- package/es6-modern/PhoneNumber.js +5 -5
- package/es6-modern/PhoneNumber.js.map +1 -1
- package/es6-modern/PhoneNumber.test.js.map +1 -1
- package/es6-modern/PhoneNumberMatcher.js +60 -60
- package/es6-modern/PhoneNumberMatcher.js.map +1 -1
- package/es6-modern/PhoneNumberMatcher.test.js.map +1 -1
- package/es6-modern/constants.js.map +1 -1
- package/es6-modern/findNumbers/LRUCache.js.map +1 -1
- package/es6-modern/findNumbers/Leniency.js +34 -34
- package/es6-modern/findNumbers/Leniency.js.map +1 -1
- package/es6-modern/findNumbers/RegExpCache.js.map +1 -1
- package/es6-modern/findNumbers/isValidCandidate.js +14 -14
- package/es6-modern/findNumbers/isValidCandidate.js.map +1 -1
- package/es6-modern/findNumbers/isValidPreCandidate.js.map +1 -1
- package/es6-modern/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +6 -6
- package/es6-modern/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js.map +1 -1
- package/es6-modern/findNumbers/parsePreCandidate.js.map +1 -1
- package/es6-modern/findNumbers/utf-8.js +19 -19
- package/es6-modern/findNumbers/utf-8.js.map +1 -1
- package/es6-modern/findNumbers/util.js +3 -3
- package/es6-modern/findNumbers/util.js.map +1 -1
- package/es6-modern/findNumbers/util.test.js.map +1 -1
- package/es6-modern/findPhoneNumbersInText.js.map +1 -1
- package/es6-modern/findPhoneNumbersInText.test.js.map +1 -1
- package/es6-modern/format.js +14 -14
- package/es6-modern/format.js.map +1 -1
- package/es6-modern/format.test.js.map +1 -1
- package/es6-modern/formatIncompletePhoneNumber.js +7 -7
- package/es6-modern/formatIncompletePhoneNumber.js.map +1 -1
- package/es6-modern/formatIncompletePhoneNumber.test.js.map +1 -1
- package/es6-modern/formatPhoneNumberForMobileDialing.js +35 -35
- package/es6-modern/formatPhoneNumberForMobileDialing.js.map +1 -1
- package/es6-modern/getCountries.js.map +1 -1
- package/es6-modern/getCountries.test.js.map +1 -1
- package/es6-modern/getCountryCallingCode.js.map +1 -1
- package/es6-modern/getCountryCallingCode.test.js.map +1 -1
- package/es6-modern/getExampleNumber.js.map +1 -1
- package/es6-modern/getExampleNumber.test.js.map +1 -1
- package/es6-modern/helpers/RFC3966.js +6 -6
- package/es6-modern/helpers/RFC3966.js.map +1 -1
- package/es6-modern/helpers/RFC3966.test.js.map +1 -1
- package/es6-modern/helpers/applyInternationalSeparatorStyle.js.map +1 -1
- package/es6-modern/helpers/applyInternationalSeparatorStyle.test.js.map +1 -1
- package/es6-modern/helpers/checkNumberLength.js +15 -15
- package/es6-modern/helpers/checkNumberLength.js.map +1 -1
- package/es6-modern/helpers/checkNumberLength.test.js.map +1 -1
- package/es6-modern/helpers/extension/createExtensionPattern.js +10 -10
- package/es6-modern/helpers/extension/createExtensionPattern.js.map +1 -1
- package/es6-modern/helpers/extension/extractExtension.js.map +1 -1
- package/es6-modern/helpers/extractCountryCallingCode.js +23 -23
- package/es6-modern/helpers/extractCountryCallingCode.js.map +1 -1
- package/es6-modern/helpers/extractCountryCallingCode.test.js.map +1 -1
- package/es6-modern/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +9 -9
- package/es6-modern/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
- package/es6-modern/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.test.js.map +1 -1
- package/es6-modern/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +4 -4
- package/es6-modern/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
- package/es6-modern/helpers/extractNationalNumber.js +15 -15
- package/es6-modern/helpers/extractNationalNumber.js.map +1 -1
- package/es6-modern/helpers/extractNationalNumber.test.js.map +1 -1
- package/es6-modern/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +12 -12
- package/es6-modern/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
- package/es6-modern/helpers/extractNationalNumberFromPossiblyIncompleteNumber.test.js.map +1 -1
- package/es6-modern/helpers/extractPhoneContext.js +17 -17
- package/es6-modern/helpers/extractPhoneContext.js.map +1 -1
- package/es6-modern/helpers/extractPhoneContext.test.js.map +1 -1
- package/es6-modern/helpers/formatNationalNumberUsingFormat.js.map +1 -1
- package/es6-modern/helpers/getCountryAndCallingCodeFromOneOfThem.js.map +1 -1
- package/es6-modern/helpers/getCountryByCallingCode.js +7 -7
- package/es6-modern/helpers/getCountryByCallingCode.js.map +1 -1
- package/es6-modern/helpers/getCountryByNationalNumber.js +7 -7
- package/es6-modern/helpers/getCountryByNationalNumber.js.map +1 -1
- package/es6-modern/helpers/getIddPrefix.js +8 -8
- package/es6-modern/helpers/getIddPrefix.js.map +1 -1
- package/es6-modern/helpers/getNumberType.js.map +1 -1
- package/es6-modern/helpers/getNumberType.test.js.map +1 -1
- package/es6-modern/helpers/getPossibleCountriesForNumber.js +6 -6
- package/es6-modern/helpers/getPossibleCountriesForNumber.js.map +1 -1
- package/es6-modern/helpers/isCallingCode.js.map +1 -1
- package/es6-modern/helpers/isCallingCode.test.js.map +1 -1
- package/es6-modern/helpers/isCountryCode.js.map +1 -1
- package/es6-modern/helpers/isCountryCode.test.js.map +1 -1
- package/es6-modern/helpers/isObject.js.map +1 -1
- package/es6-modern/helpers/isViablePhoneNumber.js.map +1 -1
- package/es6-modern/helpers/matchesEntirely.js +4 -4
- package/es6-modern/helpers/matchesEntirely.js.map +1 -1
- package/es6-modern/helpers/matchesEntirely.test.js.map +1 -1
- package/es6-modern/helpers/mergeArrays.js +5 -5
- package/es6-modern/helpers/mergeArrays.js.map +1 -1
- package/es6-modern/helpers/mergeArrays.test.js.map +1 -1
- package/es6-modern/helpers/parseDigits.js +12 -12
- package/es6-modern/helpers/parseDigits.js.map +1 -1
- package/es6-modern/helpers/parseDigits.test.js.map +1 -1
- package/es6-modern/helpers/stripIddPrefix.js.map +1 -1
- package/es6-modern/helpers/stripIddPrefix.test.js.map +1 -1
- package/es6-modern/isPossible.js +17 -17
- package/es6-modern/isPossible.js.map +1 -1
- package/es6-modern/isPossible.test.js.map +1 -1
- package/es6-modern/isPossiblePhoneNumber.js.map +1 -1
- package/es6-modern/isPossiblePhoneNumber.test.js.map +1 -1
- package/es6-modern/isValid.js +33 -33
- package/es6-modern/isValid.js.map +1 -1
- package/es6-modern/isValid.test.js.map +1 -1
- package/es6-modern/isValidPhoneNumber.js.map +1 -1
- package/es6-modern/isValidPhoneNumber.test.js.map +1 -1
- package/es6-modern/legacy/PhoneNumberSearch.js +4 -4
- package/es6-modern/legacy/PhoneNumberSearch.js.map +1 -1
- package/es6-modern/legacy/findNumbers.js.map +1 -1
- package/es6-modern/legacy/findNumbers.test.js.map +1 -1
- package/es6-modern/legacy/findPhoneNumbers.js +2 -2
- package/es6-modern/legacy/findPhoneNumbers.js.map +1 -1
- package/es6-modern/legacy/findPhoneNumbers.test.js.map +1 -1
- package/es6-modern/legacy/findPhoneNumbersInitialImplementation.js +16 -16
- package/es6-modern/legacy/findPhoneNumbersInitialImplementation.js.map +1 -1
- package/es6-modern/legacy/format.js.map +1 -1
- package/es6-modern/legacy/format.test.js.map +1 -1
- package/es6-modern/legacy/getNumberType.js.map +1 -1
- package/es6-modern/legacy/getNumberType.test.js.map +1 -1
- package/es6-modern/legacy/isPossibleNumber.js +13 -13
- package/es6-modern/legacy/isPossibleNumber.js.map +1 -1
- package/es6-modern/legacy/isPossibleNumber.test.js.map +1 -1
- package/es6-modern/legacy/isValidNumber.js.map +1 -1
- package/es6-modern/legacy/isValidNumber.test.js.map +1 -1
- package/es6-modern/legacy/isValidNumberForRegion.js.map +1 -1
- package/es6-modern/legacy/isValidNumberForRegion.test.js.map +1 -1
- package/es6-modern/legacy/isValidNumberForRegion_.js +4 -4
- package/es6-modern/legacy/isValidNumberForRegion_.js.map +1 -1
- package/es6-modern/legacy/parse.js.map +1 -1
- package/es6-modern/legacy/parse.test.js.map +1 -1
- package/es6-modern/legacy/searchNumbers.js +2 -2
- package/es6-modern/legacy/searchNumbers.js.map +1 -1
- package/es6-modern/legacy/searchNumbers.test.js.map +1 -1
- package/es6-modern/metadata.js +40 -40
- package/es6-modern/metadata.js.map +1 -1
- package/es6-modern/metadata.test.js.map +1 -1
- package/es6-modern/normalizeArguments.js.map +1 -1
- package/es6-modern/parse.js +36 -36
- package/es6-modern/parse.js.map +1 -1
- package/es6-modern/parse.test.js.map +1 -1
- package/es6-modern/parseIncompletePhoneNumber.js +24 -24
- package/es6-modern/parseIncompletePhoneNumber.js.map +1 -1
- package/es6-modern/parseIncompletePhoneNumber.test.js.map +1 -1
- package/es6-modern/parsePhoneNumber.js.map +1 -1
- package/es6-modern/parsePhoneNumber.test.js.map +1 -1
- package/es6-modern/parsePhoneNumberWithError.js.map +1 -1
- package/es6-modern/parsePhoneNumberWithError.test.js.map +1 -1
- package/es6-modern/parsePhoneNumberWithError_.js.map +1 -1
- package/es6-modern/parsePhoneNumber_.js.map +1 -1
- package/es6-modern/searchPhoneNumbersInText.js.map +1 -1
- package/es6-modern/searchPhoneNumbersInText.test.js.map +1 -1
- package/es6-modern/tools/semver-compare.js.map +1 -1
- package/es6-modern/tools/semver-compare.test.js.map +1 -1
- package/es6-modern/validatePhoneNumberLength.js.map +1 -1
- package/es6-modern/validatePhoneNumberLength.test.js.map +1 -1
- package/examples.mobile.json.d.cts +3 -3
- package/examples.mobile.json.d.ts +3 -3
- package/index.cjs +129 -129
- package/index.cjs.js +135 -135
- package/index.d.cts +232 -232
- package/index.d.ts +232 -232
- package/index.es6.exports/PhoneNumberSearch.js +13 -13
- package/index.es6.exports/findPhoneNumbers.js +7 -7
- package/index.es6.exports/format.js +7 -7
- package/index.es6.exports/getNumberType.js +7 -7
- package/index.es6.exports/isPossibleNumber.js +9 -9
- package/index.es6.exports/isValidNumber.js +9 -9
- package/index.es6.exports/isValidNumberForRegion.js +7 -7
- package/index.es6.exports/parse.js +7 -7
- package/index.es6.exports/searchPhoneNumbers.js +7 -7
- package/index.es6.js +5 -5
- package/index.js +72 -72
- package/max/es6/exports/AsYouType.js +11 -11
- package/max/es6/exports/Metadata.js +11 -11
- package/max/es6/exports/PhoneNumber.js +11 -11
- package/max/es6/exports/PhoneNumberMatcher.js +11 -11
- package/max/es6/exports/findNumbers.js +5 -5
- package/max/es6/exports/findPhoneNumbersInText.js +5 -5
- package/max/es6/exports/formatIncompletePhoneNumber.js +5 -5
- package/max/es6/exports/getCountries.js +5 -5
- package/max/es6/exports/getCountryCallingCode.js +5 -5
- package/max/es6/exports/getExampleNumber.js +5 -5
- package/max/es6/exports/getExtPrefix.js +5 -5
- package/max/es6/exports/isPossiblePhoneNumber.js +5 -5
- package/max/es6/exports/isSupportedCountry.js +5 -5
- package/max/es6/exports/isValidPhoneNumber.js +5 -5
- package/max/es6/exports/parsePhoneNumber.js +6 -6
- package/max/es6/exports/parsePhoneNumberWithError.js +7 -7
- package/max/es6/exports/searchNumbers.js +5 -5
- package/max/es6/exports/searchPhoneNumbersInText.js +5 -5
- package/max/es6/exports/validatePhoneNumberLength.js +5 -5
- package/max/es6/exports/withMetadataArgument.js +12 -12
- package/max/es6/index.d.cts +2 -2
- package/max/es6/index.d.ts +2 -2
- package/max/es6/index.js +44 -44
- package/max/es6/package.json +12 -12
- package/max/exports/AsYouType.js +11 -11
- package/max/exports/Metadata.js +11 -11
- package/max/exports/PhoneNumber.js +21 -21
- package/max/exports/PhoneNumberMatcher.js +11 -11
- package/max/exports/findNumbers.js +5 -5
- package/max/exports/findPhoneNumbersInText.js +5 -5
- package/max/exports/formatIncompletePhoneNumber.js +5 -5
- package/max/exports/getCountries.js +5 -5
- package/max/exports/getCountryCallingCode.js +5 -5
- package/max/exports/getExampleNumber.js +5 -5
- package/max/exports/getExtPrefix.js +5 -5
- package/max/exports/isPossiblePhoneNumber.js +5 -5
- package/max/exports/isSupportedCountry.js +5 -5
- package/max/exports/isValidPhoneNumber.js +5 -5
- package/max/exports/parsePhoneNumber.js +5 -5
- package/max/exports/parsePhoneNumberWithError.js +6 -6
- package/max/exports/searchNumbers.js +5 -5
- package/max/exports/searchPhoneNumbersInText.js +5 -5
- package/max/exports/validatePhoneNumberLength.js +5 -5
- package/max/exports/withMetadataArgument.js +8 -8
- package/max/index.cjs +113 -113
- package/max/index.cjs.js +118 -118
- package/max/index.d.cts +137 -137
- package/max/index.d.ts +137 -137
- package/max/index.js +44 -44
- package/max/metadata/metadata.max.json +1 -1
- package/max/metadata/metadata.max.json.d.cts +4 -4
- package/max/metadata/metadata.max.json.d.ts +4 -4
- package/max/metadata/metadata.max.json.js +1 -1
- package/max/metadata/package.json +16 -16
- package/max/package.json +14 -14
- package/metadata.full.json +1 -1
- package/metadata.full.json.d.cts +4 -4
- package/metadata.full.json.d.ts +4 -4
- package/metadata.full.json.js +1 -1
- package/metadata.max.json +1 -1
- package/metadata.max.json.d.cts +4 -4
- package/metadata.max.json.d.ts +4 -4
- package/metadata.max.json.js +1 -1
- package/metadata.min.json +1 -1
- package/metadata.min.json.d.cts +4 -4
- package/metadata.min.json.d.ts +4 -4
- package/metadata.min.json.js +1 -1
- package/metadata.mobile.json +1 -1
- package/metadata.mobile.json.d.cts +4 -4
- package/metadata.mobile.json.d.ts +4 -4
- package/metadata.mobile.json.js +1 -1
- package/min/es6/exports/AsYouType.js +11 -11
- package/min/es6/exports/Metadata.js +11 -11
- package/min/es6/exports/PhoneNumber.js +11 -11
- package/min/es6/exports/PhoneNumberMatcher.js +11 -11
- package/min/es6/exports/findNumbers.js +5 -5
- package/min/es6/exports/findPhoneNumbersInText.js +5 -5
- package/min/es6/exports/formatIncompletePhoneNumber.js +5 -5
- package/min/es6/exports/getCountries.js +5 -5
- package/min/es6/exports/getCountryCallingCode.js +5 -5
- package/min/es6/exports/getExampleNumber.js +5 -5
- package/min/es6/exports/getExtPrefix.js +5 -5
- package/min/es6/exports/isPossiblePhoneNumber.js +5 -5
- package/min/es6/exports/isSupportedCountry.js +5 -5
- package/min/es6/exports/isValidPhoneNumber.js +5 -5
- package/min/es6/exports/parsePhoneNumber.js +6 -6
- package/min/es6/exports/parsePhoneNumberWithError.js +7 -7
- package/min/es6/exports/searchNumbers.js +5 -5
- package/min/es6/exports/searchPhoneNumbersInText.js +5 -5
- package/min/es6/exports/validatePhoneNumberLength.js +5 -5
- package/min/es6/exports/withMetadataArgument.js +12 -12
- package/min/es6/index.d.cts +2 -2
- package/min/es6/index.d.ts +2 -2
- package/min/es6/index.js +44 -44
- package/min/es6/package.json +12 -12
- package/min/exports/AsYouType.js +11 -11
- package/min/exports/Metadata.js +11 -11
- package/min/exports/PhoneNumber.js +21 -21
- package/min/exports/PhoneNumberMatcher.js +11 -11
- package/min/exports/findNumbers.js +5 -5
- package/min/exports/findPhoneNumbersInText.js +5 -5
- package/min/exports/formatIncompletePhoneNumber.js +5 -5
- package/min/exports/getCountries.js +5 -5
- package/min/exports/getCountryCallingCode.js +5 -5
- package/min/exports/getExampleNumber.js +5 -5
- package/min/exports/getExtPrefix.js +5 -5
- package/min/exports/isPossiblePhoneNumber.js +5 -5
- package/min/exports/isSupportedCountry.js +5 -5
- package/min/exports/isValidPhoneNumber.js +5 -5
- package/min/exports/parsePhoneNumber.js +5 -5
- package/min/exports/parsePhoneNumberWithError.js +6 -6
- package/min/exports/searchNumbers.js +5 -5
- package/min/exports/searchPhoneNumbersInText.js +5 -5
- package/min/exports/validatePhoneNumberLength.js +5 -5
- package/min/exports/withMetadataArgument.js +8 -8
- package/min/index.cjs +124 -124
- package/min/index.cjs.js +129 -129
- package/min/index.d.cts +137 -137
- package/min/index.d.ts +137 -137
- package/min/index.js +43 -43
- package/min/metadata/metadata.min.json +1 -1
- package/min/metadata/metadata.min.json.d.cts +4 -4
- package/min/metadata/metadata.min.json.d.ts +4 -4
- package/min/metadata/metadata.min.json.js +1 -1
- package/min/metadata/package.json +16 -16
- package/min/package.json +14 -14
- package/mobile/es6/exports/AsYouType.js +11 -11
- package/mobile/es6/exports/Metadata.js +11 -11
- package/mobile/es6/exports/PhoneNumber.js +11 -11
- package/mobile/es6/exports/PhoneNumberMatcher.js +11 -11
- package/mobile/es6/exports/findNumbers.js +5 -5
- package/mobile/es6/exports/findPhoneNumbersInText.js +5 -5
- package/mobile/es6/exports/formatIncompletePhoneNumber.js +5 -5
- package/mobile/es6/exports/getCountries.js +5 -5
- package/mobile/es6/exports/getCountryCallingCode.js +5 -5
- package/mobile/es6/exports/getExampleNumber.js +5 -5
- package/mobile/es6/exports/getExtPrefix.js +5 -5
- package/mobile/es6/exports/isPossiblePhoneNumber.js +5 -5
- package/mobile/es6/exports/isSupportedCountry.js +5 -5
- package/mobile/es6/exports/isValidPhoneNumber.js +5 -5
- package/mobile/es6/exports/parsePhoneNumber.js +6 -6
- package/mobile/es6/exports/parsePhoneNumberWithError.js +7 -7
- package/mobile/es6/exports/searchNumbers.js +5 -5
- package/mobile/es6/exports/searchPhoneNumbersInText.js +5 -5
- package/mobile/es6/exports/validatePhoneNumberLength.js +5 -5
- package/mobile/es6/exports/withMetadataArgument.js +12 -12
- package/mobile/es6/index.d.cts +2 -2
- package/mobile/es6/index.d.ts +2 -2
- package/mobile/es6/index.js +44 -44
- package/mobile/es6/package.json +12 -12
- package/mobile/examples/examples.mobile.json.d.cts +3 -3
- package/mobile/examples/examples.mobile.json.d.ts +3 -3
- package/mobile/examples/package.json +16 -16
- package/mobile/exports/AsYouType.js +11 -11
- package/mobile/exports/Metadata.js +11 -11
- package/mobile/exports/PhoneNumber.js +21 -21
- package/mobile/exports/PhoneNumberMatcher.js +11 -11
- package/mobile/exports/findNumbers.js +5 -5
- package/mobile/exports/findPhoneNumbersInText.js +5 -5
- package/mobile/exports/formatIncompletePhoneNumber.js +5 -5
- package/mobile/exports/getCountries.js +5 -5
- package/mobile/exports/getCountryCallingCode.js +5 -5
- package/mobile/exports/getExampleNumber.js +5 -5
- package/mobile/exports/getExtPrefix.js +5 -5
- package/mobile/exports/isPossiblePhoneNumber.js +5 -5
- package/mobile/exports/isSupportedCountry.js +5 -5
- package/mobile/exports/isValidPhoneNumber.js +5 -5
- package/mobile/exports/parsePhoneNumber.js +5 -5
- package/mobile/exports/parsePhoneNumberWithError.js +6 -6
- package/mobile/exports/searchNumbers.js +5 -5
- package/mobile/exports/searchPhoneNumbersInText.js +5 -5
- package/mobile/exports/validatePhoneNumberLength.js +5 -5
- package/mobile/exports/withMetadataArgument.js +8 -8
- package/mobile/index.cjs +113 -113
- package/mobile/index.cjs.js +118 -118
- package/mobile/index.d.cts +137 -137
- package/mobile/index.d.ts +137 -137
- package/mobile/index.js +44 -44
- package/mobile/metadata/metadata.mobile.json +1 -1
- package/mobile/metadata/metadata.mobile.json.d.cts +4 -4
- package/mobile/metadata/metadata.mobile.json.d.ts +4 -4
- package/mobile/metadata/metadata.mobile.json.js +1 -1
- package/mobile/metadata/package.json +16 -16
- package/mobile/package.json +14 -14
- package/package.json +202 -202
- package/source/AsYouType.js +539 -539
- package/source/AsYouTypeFormatter.PatternMatcher.d.ts +66 -66
- package/source/AsYouTypeFormatter.PatternMatcher.js +196 -196
- package/source/AsYouTypeFormatter.PatternParser.d.ts +58 -58
- package/source/AsYouTypeFormatter.PatternParser.js +213 -213
- package/source/AsYouTypeFormatter.complete.js +134 -134
- package/source/AsYouTypeFormatter.js +713 -713
- package/source/AsYouTypeFormatter.util.js +99 -99
- package/source/AsYouTypeParser.js +519 -519
- package/source/AsYouTypeState.js +123 -123
- package/source/ParseError.js +13 -13
- package/source/PhoneNumber.js +161 -161
- package/source/PhoneNumberMatcher.js +398 -398
- package/source/constants.js +30 -30
- package/source/findNumbers/LRUCache.js +106 -106
- package/source/findNumbers/Leniency.js +407 -407
- package/source/findNumbers/RegExpCache.js +19 -19
- package/source/findNumbers/isValidCandidate.js +85 -85
- package/source/findNumbers/isValidPreCandidate.js +28 -28
- package/source/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +63 -63
- package/source/findNumbers/parsePreCandidate.js +18 -18
- package/source/findNumbers/utf-8.js +81 -81
- package/source/findNumbers/util.js +33 -33
- package/source/findPhoneNumbersInText.js +11 -11
- package/source/format.js +235 -235
- package/source/formatIncompletePhoneNumber.js +16 -16
- package/source/formatPhoneNumberForMobileDialing.js +224 -224
- package/source/getCountries.js +4 -4
- package/source/getCountryCallingCode.js +1 -1
- package/source/getExampleNumber.js +6 -6
- package/source/helpers/RFC3966.js +58 -58
- package/source/helpers/applyInternationalSeparatorStyle.js +34 -34
- package/source/helpers/checkNumberLength.js +133 -133
- package/source/helpers/extension/createExtensionPattern.js +111 -111
- package/source/helpers/extension/extractExtension.js +28 -28
- package/source/helpers/extractCountryCallingCode.js +160 -160
- package/source/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +83 -83
- package/source/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +73 -73
- package/source/helpers/extractNationalNumber.js +123 -123
- package/source/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +103 -103
- package/source/helpers/extractPhoneContext.js +102 -102
- package/source/helpers/formatNationalNumberUsingFormat.js +45 -45
- package/source/helpers/getCountryAndCallingCodeFromOneOfThem.js +30 -30
- package/source/helpers/getCountryByCallingCode.js +32 -32
- package/source/helpers/getCountryByNationalNumber.js +75 -75
- package/source/helpers/getIddPrefix.js +25 -25
- package/source/helpers/getNumberType.js +101 -101
- package/source/helpers/getPossibleCountriesForNumber.js +24 -24
- package/source/helpers/isCallingCode.js +5 -5
- package/source/helpers/isCountryCode.js +5 -5
- package/source/helpers/isObject.js +5 -5
- package/source/helpers/isViablePhoneNumber.js +107 -107
- package/source/helpers/matchesEntirely.js +10 -10
- package/source/helpers/mergeArrays.js +23 -23
- package/source/helpers/parseDigits.js +81 -81
- package/source/helpers/stripIddPrefix.js +35 -35
- package/source/isPossible.js +84 -84
- package/source/isPossiblePhoneNumber.js +11 -11
- package/source/isValid.js +58 -58
- package/source/isValidPhoneNumber.js +11 -11
- package/source/legacy/PhoneNumberSearch.js +121 -121
- package/source/legacy/findNumbers.js +11 -11
- package/source/legacy/findPhoneNumbers.js +19 -19
- package/source/legacy/findPhoneNumbersInitialImplementation.js +81 -81
- package/source/legacy/format.js +116 -116
- package/source/legacy/getNumberType.js +120 -120
- package/source/legacy/isPossibleNumber.js +24 -24
- package/source/legacy/isValidNumber.js +11 -11
- package/source/legacy/isValidNumberForRegion.js +61 -61
- package/source/legacy/isValidNumberForRegion_.js +12 -12
- package/source/legacy/parse.js +6 -6
- package/source/legacy/searchNumbers.js +30 -30
- package/source/metadata.js +580 -580
- package/source/normalizeArguments.js +54 -54
- package/source/parse.js +403 -403
- package/source/parseIncompletePhoneNumber.js +68 -68
- package/source/parsePhoneNumber.js +7 -7
- package/source/parsePhoneNumberWithError.js +6 -6
- package/source/parsePhoneNumberWithError_.js +4 -4
- package/source/parsePhoneNumber_.js +24 -24
- package/source/searchPhoneNumbersInText.js +23 -23
- package/source/tools/semver-compare.js +25 -25
- package/source/validatePhoneNumberLength.js +30 -30
- package/types.d.cts +181 -181
- package/types.d.ts +181 -181
package/custom.js
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
// The `/custom` export has been long deprecated: use `/core` export instead.
|
|
2
|
-
|
|
3
|
-
'use strict'
|
|
4
|
-
|
|
5
|
-
var parsePhoneNumberFromString = require('./build/parsePhoneNumber.js').default
|
|
6
|
-
|
|
7
|
-
// ES5 `require()` "default" "interoperability" hack.
|
|
8
|
-
// https://github.com/babel/babel/issues/2212#issuecomment-131827986
|
|
9
|
-
// An alternative approach:
|
|
10
|
-
// https://www.npmjs.com/package/babel-plugin-add-module-exports
|
|
11
|
-
exports = module.exports = parsePhoneNumberFromString
|
|
12
|
-
exports['default'] = parsePhoneNumberFromString
|
|
13
|
-
|
|
14
|
-
exports.PhoneNumber = require('./build/PhoneNumber.js').default
|
|
15
|
-
exports.ParseError = require('./build/ParseError.js').default
|
|
16
|
-
var parsePhoneNumberWithError = require('./build/parsePhoneNumberWithError.js').default
|
|
17
|
-
// `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`.
|
|
18
|
-
exports.parsePhoneNumber = parsePhoneNumberWithError
|
|
19
|
-
exports.parsePhoneNumberWithError = parsePhoneNumberWithError
|
|
20
|
-
|
|
21
|
-
// `parsePhoneNumberFromString()` named export is now considered legacy:
|
|
22
|
-
// it has been promoted to a default export due to being too verbose.
|
|
23
|
-
exports.parsePhoneNumberFromString = parsePhoneNumberFromString
|
|
24
|
-
|
|
25
|
-
// Deprecated: remove `parse()` export in 2.0.0.
|
|
26
|
-
// (renamed to `parseNumber()`)
|
|
27
|
-
exports.parse = require('./build/legacy/parse.js').default
|
|
28
|
-
exports.parseNumber = require('./build/legacy/parse.js').default
|
|
29
|
-
// Deprecated: remove `format()` export in 2.0.0.
|
|
30
|
-
// (renamed to `formatNumber()`)
|
|
31
|
-
exports.format = require('./build/legacy/format.js').default
|
|
32
|
-
exports.formatNumber = require('./build/legacy/format.js').default
|
|
33
|
-
exports.getNumberType = require('./build/legacy/getNumberType.js').default
|
|
34
|
-
exports.isValidNumber = require('./build/legacy/isValidNumber.js').default
|
|
35
|
-
exports.isValidNumberForRegion = require('./build/legacy/isValidNumberForRegion.js').default
|
|
36
|
-
|
|
37
|
-
// Deprecated.
|
|
38
|
-
exports.isPossibleNumber = require('./build/legacy/isPossibleNumber.js').default
|
|
39
|
-
exports.findNumbers = require('./build/legacy/findNumbers.js').default
|
|
40
|
-
exports.searchNumbers = require('./build/legacy/searchNumbers.js').default
|
|
41
|
-
exports.findPhoneNumbers = require('./build/legacy/findPhoneNumbers.js').default
|
|
42
|
-
exports.searchPhoneNumbers = require('./build/legacy/findPhoneNumbers.js').searchPhoneNumbers
|
|
43
|
-
exports.PhoneNumberSearch = require('./build/legacy/PhoneNumberSearch.js').default
|
|
44
|
-
|
|
45
|
-
exports.getExampleNumber = require('./build/getExampleNumber.js').default
|
|
46
|
-
|
|
47
|
-
exports.findPhoneNumbersInText = require('./build/findPhoneNumbersInText.js').default
|
|
48
|
-
exports.searchPhoneNumbersInText = require('./build/searchPhoneNumbersInText.js').default
|
|
49
|
-
exports.PhoneNumberMatcher = require('./build/PhoneNumberMatcher.js').default
|
|
50
|
-
|
|
51
|
-
exports.AsYouType = require('./build/AsYouType.js').default
|
|
52
|
-
|
|
53
|
-
exports.formatIncompletePhoneNumber = require('./build/formatIncompletePhoneNumber.js').default
|
|
54
|
-
exports.parseIncompletePhoneNumber = require('./build/parseIncompletePhoneNumber.js').default
|
|
55
|
-
exports.parsePhoneNumberCharacter = require('./build/parseIncompletePhoneNumber.js').parsePhoneNumberCharacter
|
|
56
|
-
exports.parseDigits = require('./build/helpers/parseDigits.js').default
|
|
57
|
-
|
|
58
|
-
// Deprecated: `DIGITS` were used by `react-phone-number-input`.
|
|
59
|
-
// Replaced by `parseDigits()`.
|
|
60
|
-
exports.DIGITS = require('./build/helpers/parseDigits.js').DIGITS
|
|
61
|
-
// Deprecated:
|
|
62
|
-
// `DIGIT_PLACEHOLDER` is the character that `AsYouType` formatter uses in a phone number template.
|
|
63
|
-
// It's basically an "x" character. I guess, there's no point in exporting it as a constant
|
|
64
|
-
// because the established convention is that it's an "x" character so everyone just assumes "x".
|
|
65
|
-
exports.DIGIT_PLACEHOLDER = require('./build/AsYouTypeFormatter.js').DIGIT_PLACEHOLDER
|
|
66
|
-
|
|
67
|
-
exports.getCountries = require('./build/getCountries.js').default
|
|
68
|
-
exports.getCountryCallingCode = require('./build/getCountryCallingCode.js').default
|
|
69
|
-
// `getPhoneCode` name is deprecated, use `getCountryCallingCode` instead.
|
|
70
|
-
exports.getPhoneCode = exports.getCountryCallingCode
|
|
71
|
-
|
|
72
|
-
exports.Metadata = require('./build/metadata.js').default
|
|
73
|
-
exports.isSupportedCountry = require('./build/metadata.js').isSupportedCountry
|
|
74
|
-
exports.getExtPrefix = require('./build/metadata.js').getExtPrefix
|
|
75
|
-
|
|
76
|
-
exports.parseRFC3966 = require('./build/helpers/RFC3966.js').parseRFC3966
|
|
77
|
-
exports.formatRFC3966 = require('./build/helpers/RFC3966.js').formatRFC3966
|
|
78
|
-
|
|
1
|
+
// The `/custom` export has been long deprecated: use `/core` export instead.
|
|
2
|
+
|
|
3
|
+
'use strict'
|
|
4
|
+
|
|
5
|
+
var parsePhoneNumberFromString = require('./build/parsePhoneNumber.js').default
|
|
6
|
+
|
|
7
|
+
// ES5 `require()` "default" "interoperability" hack.
|
|
8
|
+
// https://github.com/babel/babel/issues/2212#issuecomment-131827986
|
|
9
|
+
// An alternative approach:
|
|
10
|
+
// https://www.npmjs.com/package/babel-plugin-add-module-exports
|
|
11
|
+
exports = module.exports = parsePhoneNumberFromString
|
|
12
|
+
exports['default'] = parsePhoneNumberFromString
|
|
13
|
+
|
|
14
|
+
exports.PhoneNumber = require('./build/PhoneNumber.js').default
|
|
15
|
+
exports.ParseError = require('./build/ParseError.js').default
|
|
16
|
+
var parsePhoneNumberWithError = require('./build/parsePhoneNumberWithError.js').default
|
|
17
|
+
// `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`.
|
|
18
|
+
exports.parsePhoneNumber = parsePhoneNumberWithError
|
|
19
|
+
exports.parsePhoneNumberWithError = parsePhoneNumberWithError
|
|
20
|
+
|
|
21
|
+
// `parsePhoneNumberFromString()` named export is now considered legacy:
|
|
22
|
+
// it has been promoted to a default export due to being too verbose.
|
|
23
|
+
exports.parsePhoneNumberFromString = parsePhoneNumberFromString
|
|
24
|
+
|
|
25
|
+
// Deprecated: remove `parse()` export in 2.0.0.
|
|
26
|
+
// (renamed to `parseNumber()`)
|
|
27
|
+
exports.parse = require('./build/legacy/parse.js').default
|
|
28
|
+
exports.parseNumber = require('./build/legacy/parse.js').default
|
|
29
|
+
// Deprecated: remove `format()` export in 2.0.0.
|
|
30
|
+
// (renamed to `formatNumber()`)
|
|
31
|
+
exports.format = require('./build/legacy/format.js').default
|
|
32
|
+
exports.formatNumber = require('./build/legacy/format.js').default
|
|
33
|
+
exports.getNumberType = require('./build/legacy/getNumberType.js').default
|
|
34
|
+
exports.isValidNumber = require('./build/legacy/isValidNumber.js').default
|
|
35
|
+
exports.isValidNumberForRegion = require('./build/legacy/isValidNumberForRegion.js').default
|
|
36
|
+
|
|
37
|
+
// Deprecated.
|
|
38
|
+
exports.isPossibleNumber = require('./build/legacy/isPossibleNumber.js').default
|
|
39
|
+
exports.findNumbers = require('./build/legacy/findNumbers.js').default
|
|
40
|
+
exports.searchNumbers = require('./build/legacy/searchNumbers.js').default
|
|
41
|
+
exports.findPhoneNumbers = require('./build/legacy/findPhoneNumbers.js').default
|
|
42
|
+
exports.searchPhoneNumbers = require('./build/legacy/findPhoneNumbers.js').searchPhoneNumbers
|
|
43
|
+
exports.PhoneNumberSearch = require('./build/legacy/PhoneNumberSearch.js').default
|
|
44
|
+
|
|
45
|
+
exports.getExampleNumber = require('./build/getExampleNumber.js').default
|
|
46
|
+
|
|
47
|
+
exports.findPhoneNumbersInText = require('./build/findPhoneNumbersInText.js').default
|
|
48
|
+
exports.searchPhoneNumbersInText = require('./build/searchPhoneNumbersInText.js').default
|
|
49
|
+
exports.PhoneNumberMatcher = require('./build/PhoneNumberMatcher.js').default
|
|
50
|
+
|
|
51
|
+
exports.AsYouType = require('./build/AsYouType.js').default
|
|
52
|
+
|
|
53
|
+
exports.formatIncompletePhoneNumber = require('./build/formatIncompletePhoneNumber.js').default
|
|
54
|
+
exports.parseIncompletePhoneNumber = require('./build/parseIncompletePhoneNumber.js').default
|
|
55
|
+
exports.parsePhoneNumberCharacter = require('./build/parseIncompletePhoneNumber.js').parsePhoneNumberCharacter
|
|
56
|
+
exports.parseDigits = require('./build/helpers/parseDigits.js').default
|
|
57
|
+
|
|
58
|
+
// Deprecated: `DIGITS` were used by `react-phone-number-input`.
|
|
59
|
+
// Replaced by `parseDigits()`.
|
|
60
|
+
exports.DIGITS = require('./build/helpers/parseDigits.js').DIGITS
|
|
61
|
+
// Deprecated:
|
|
62
|
+
// `DIGIT_PLACEHOLDER` is the character that `AsYouType` formatter uses in a phone number template.
|
|
63
|
+
// It's basically an "x" character. I guess, there's no point in exporting it as a constant
|
|
64
|
+
// because the established convention is that it's an "x" character so everyone just assumes "x".
|
|
65
|
+
exports.DIGIT_PLACEHOLDER = require('./build/AsYouTypeFormatter.js').DIGIT_PLACEHOLDER
|
|
66
|
+
|
|
67
|
+
exports.getCountries = require('./build/getCountries.js').default
|
|
68
|
+
exports.getCountryCallingCode = require('./build/getCountryCallingCode.js').default
|
|
69
|
+
// `getPhoneCode` name is deprecated, use `getCountryCallingCode` instead.
|
|
70
|
+
exports.getPhoneCode = exports.getCountryCallingCode
|
|
71
|
+
|
|
72
|
+
exports.Metadata = require('./build/metadata.js').default
|
|
73
|
+
exports.isSupportedCountry = require('./build/metadata.js').isSupportedCountry
|
|
74
|
+
exports.getExtPrefix = require('./build/metadata.js').getExtPrefix
|
|
75
|
+
|
|
76
|
+
exports.parseRFC3966 = require('./build/helpers/RFC3966.js').parseRFC3966
|
|
77
|
+
exports.formatRFC3966 = require('./build/helpers/RFC3966.js').formatRFC3966
|
|
78
|
+
|
|
79
79
|
// exports['default'] = ...
|
package/es6/AsYouType.js
CHANGED
|
@@ -21,9 +21,9 @@ import getCountryByNationalNumber from './helpers/getCountryByNationalNumber.js'
|
|
|
21
21
|
import isObject from './helpers/isObject.js';
|
|
22
22
|
var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;
|
|
23
23
|
var AsYouType = /*#__PURE__*/function () {
|
|
24
|
-
/**
|
|
25
|
-
* @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.
|
|
26
|
-
* @param {Object} metadata
|
|
24
|
+
/**
|
|
25
|
+
* @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.
|
|
26
|
+
* @param {Object} metadata
|
|
27
27
|
*/
|
|
28
28
|
function AsYouType(optionsOrDefaultCountry, metadata) {
|
|
29
29
|
_classCallCheck(this, AsYouType);
|
|
@@ -71,10 +71,10 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
71
71
|
return [defaultCountry, defaultCallingCode];
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
/**
|
|
75
|
-
* Inputs "next" phone number characters.
|
|
76
|
-
* @param {string} text
|
|
77
|
-
* @return {string} Formatted phone number characters that have been input so far.
|
|
74
|
+
/**
|
|
75
|
+
* Inputs "next" phone number characters.
|
|
76
|
+
* @param {string} text
|
|
77
|
+
* @return {string} Formatted phone number characters that have been input so far.
|
|
78
78
|
*/
|
|
79
79
|
}, {
|
|
80
80
|
key: "input",
|
|
@@ -150,10 +150,10 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
150
150
|
return this;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
/**
|
|
154
|
-
* Returns `true` if the phone number is being input in international format.
|
|
155
|
-
* In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
|
|
156
|
-
* @return {boolean}
|
|
153
|
+
/**
|
|
154
|
+
* Returns `true` if the phone number is being input in international format.
|
|
155
|
+
* In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
|
|
156
|
+
* @return {boolean}
|
|
157
157
|
*/
|
|
158
158
|
}, {
|
|
159
159
|
key: "isInternational",
|
|
@@ -161,11 +161,11 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
161
161
|
return this.state.international;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
/**
|
|
165
|
-
* Returns the "calling code" part of the phone number when it's being input
|
|
166
|
-
* in an international format.
|
|
167
|
-
* If no valid calling code has been entered so far, returns `undefined`.
|
|
168
|
-
* @return {string} [callingCode]
|
|
164
|
+
/**
|
|
165
|
+
* Returns the "calling code" part of the phone number when it's being input
|
|
166
|
+
* in an international format.
|
|
167
|
+
* If no valid calling code has been entered so far, returns `undefined`.
|
|
168
|
+
* @return {string} [callingCode]
|
|
169
169
|
*/
|
|
170
170
|
}, {
|
|
171
171
|
key: "getCallingCode",
|
|
@@ -190,11 +190,11 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
190
190
|
return this.getCallingCode();
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
/**
|
|
194
|
-
* Returns a two-letter country code of the phone number.
|
|
195
|
-
* Returns `undefined` for "non-geographic" phone numbering plans.
|
|
196
|
-
* Returns `undefined` if no phone number has been input yet.
|
|
197
|
-
* @return {string} [country]
|
|
193
|
+
/**
|
|
194
|
+
* Returns a two-letter country code of the phone number.
|
|
195
|
+
* Returns `undefined` for "non-geographic" phone numbering plans.
|
|
196
|
+
* Returns `undefined` if no phone number has been input yet.
|
|
197
|
+
* @return {string} [country]
|
|
198
198
|
*/
|
|
199
199
|
}, {
|
|
200
200
|
key: "getCountry",
|
|
@@ -206,10 +206,10 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
/**
|
|
210
|
-
* Returns a two-letter country code of the phone number.
|
|
211
|
-
* Returns `undefined` for "non-geographic" phone numbering plans.
|
|
212
|
-
* @return {string} [country]
|
|
209
|
+
/**
|
|
210
|
+
* Returns a two-letter country code of the phone number.
|
|
211
|
+
* Returns `undefined` for "non-geographic" phone numbering plans.
|
|
212
|
+
* @return {string} [country]
|
|
213
213
|
*/
|
|
214
214
|
}, {
|
|
215
215
|
key: "_getCountry",
|
|
@@ -341,23 +341,23 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
/**
|
|
345
|
-
* Returns a E.164 phone number value for the user's input.
|
|
346
|
-
*
|
|
347
|
-
* For example, for country `"US"` and input `"(222) 333-4444"`
|
|
348
|
-
* it will return `"+12223334444"`.
|
|
349
|
-
*
|
|
350
|
-
* For international phone number input, it will also auto-correct
|
|
351
|
-
* some minor errors such as using a national prefix when writing
|
|
352
|
-
* an international phone number. For example, if the user inputs
|
|
353
|
-
* `"+44 0 7400 000000"` then it will return an auto-corrected
|
|
354
|
-
* `"+447400000000"` phone number value.
|
|
355
|
-
*
|
|
356
|
-
* Will return `undefined` if no digits have been input,
|
|
357
|
-
* or when inputting a phone number in national format and no
|
|
358
|
-
* default country or default "country calling code" have been set.
|
|
359
|
-
*
|
|
360
|
-
* @return {string} [value]
|
|
344
|
+
/**
|
|
345
|
+
* Returns a E.164 phone number value for the user's input.
|
|
346
|
+
*
|
|
347
|
+
* For example, for country `"US"` and input `"(222) 333-4444"`
|
|
348
|
+
* it will return `"+12223334444"`.
|
|
349
|
+
*
|
|
350
|
+
* For international phone number input, it will also auto-correct
|
|
351
|
+
* some minor errors such as using a national prefix when writing
|
|
352
|
+
* an international phone number. For example, if the user inputs
|
|
353
|
+
* `"+44 0 7400 000000"` then it will return an auto-corrected
|
|
354
|
+
* `"+447400000000"` phone number value.
|
|
355
|
+
*
|
|
356
|
+
* Will return `undefined` if no digits have been input,
|
|
357
|
+
* or when inputting a phone number in national format and no
|
|
358
|
+
* default country or default "country calling code" have been set.
|
|
359
|
+
*
|
|
360
|
+
* @return {string} [value]
|
|
361
361
|
*/
|
|
362
362
|
}, {
|
|
363
363
|
key: "getNumberValue",
|
|
@@ -386,11 +386,11 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
|
|
389
|
-
/**
|
|
390
|
-
* Returns an instance of `PhoneNumber` class.
|
|
391
|
-
* Will return `undefined` if no national (significant) number
|
|
392
|
-
* digits have been entered so far, or if no `defaultCountry` has been
|
|
393
|
-
* set and the user enters a phone number not in international format.
|
|
389
|
+
/**
|
|
390
|
+
* Returns an instance of `PhoneNumber` class.
|
|
391
|
+
* Will return `undefined` if no national (significant) number
|
|
392
|
+
* digits have been entered so far, or if no `defaultCountry` has been
|
|
393
|
+
* set and the user enters a phone number not in international format.
|
|
394
394
|
*/
|
|
395
395
|
}, {
|
|
396
396
|
key: "getNumber",
|
|
@@ -464,10 +464,10 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
464
464
|
return phoneNumber;
|
|
465
465
|
}
|
|
466
466
|
|
|
467
|
-
/**
|
|
468
|
-
* Returns `true` if the phone number is "possible".
|
|
469
|
-
* Is just a shortcut for `PhoneNumber.isPossible()`.
|
|
470
|
-
* @return {boolean}
|
|
467
|
+
/**
|
|
468
|
+
* Returns `true` if the phone number is "possible".
|
|
469
|
+
* Is just a shortcut for `PhoneNumber.isPossible()`.
|
|
470
|
+
* @return {boolean}
|
|
471
471
|
*/
|
|
472
472
|
}, {
|
|
473
473
|
key: "isPossible",
|
|
@@ -479,10 +479,10 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
479
479
|
return phoneNumber.isPossible();
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
-
/**
|
|
483
|
-
* Returns `true` if the phone number is "valid".
|
|
484
|
-
* Is just a shortcut for `PhoneNumber.isValid()`.
|
|
485
|
-
* @return {boolean}
|
|
482
|
+
/**
|
|
483
|
+
* Returns `true` if the phone number is "valid".
|
|
484
|
+
* Is just a shortcut for `PhoneNumber.isValid()`.
|
|
485
|
+
* @return {boolean}
|
|
486
486
|
*/
|
|
487
487
|
}, {
|
|
488
488
|
key: "isValid",
|
|
@@ -494,11 +494,11 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
494
494
|
return phoneNumber.isValid();
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
-
/**
|
|
498
|
-
* Checks if the phone number length is valid.
|
|
499
|
-
* If it is, nothing is returned.
|
|
500
|
-
* Otherwise, a rejection reason is returned.
|
|
501
|
-
* @return {string?}
|
|
497
|
+
/**
|
|
498
|
+
* Checks if the phone number length is valid.
|
|
499
|
+
* If it is, nothing is returned.
|
|
500
|
+
* Otherwise, a rejection reason is returned.
|
|
501
|
+
* @return {string?}
|
|
502
502
|
*/
|
|
503
503
|
}, {
|
|
504
504
|
key: "validateLength",
|
|
@@ -527,10 +527,10 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
-
/**
|
|
531
|
-
* @deprecated
|
|
532
|
-
* This method is used in `react-phone-number-input/source/input-control.js`
|
|
533
|
-
* in versions before `3.0.16`.
|
|
530
|
+
/**
|
|
531
|
+
* @deprecated
|
|
532
|
+
* This method is used in `react-phone-number-input/source/input-control.js`
|
|
533
|
+
* in versions before `3.0.16`.
|
|
534
534
|
*/
|
|
535
535
|
}, {
|
|
536
536
|
key: "getNationalNumber",
|
|
@@ -538,9 +538,9 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
538
538
|
return this.state.nationalSignificantNumber;
|
|
539
539
|
}
|
|
540
540
|
|
|
541
|
-
/**
|
|
542
|
-
* Returns the phone number characters entered by the user.
|
|
543
|
-
* @return {string}
|
|
541
|
+
/**
|
|
542
|
+
* Returns the phone number characters entered by the user.
|
|
543
|
+
* @return {string}
|
|
544
544
|
*/
|
|
545
545
|
}, {
|
|
546
546
|
key: "getChars",
|
|
@@ -548,9 +548,9 @@ var AsYouType = /*#__PURE__*/function () {
|
|
|
548
548
|
return (this.state.international ? '+' : '') + this.state.digits;
|
|
549
549
|
}
|
|
550
550
|
|
|
551
|
-
/**
|
|
552
|
-
* Returns the template for the formatted phone number.
|
|
553
|
-
* @return {string}
|
|
551
|
+
/**
|
|
552
|
+
* Returns the template for the formatted phone number.
|
|
553
|
+
* @return {string}
|
|
554
554
|
*/
|
|
555
555
|
}, {
|
|
556
556
|
key: "getTemplate",
|
package/es6/AsYouType.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsYouType.js","names":["Metadata","PhoneNumber","checkNumberLength","AsYouTypeState","AsYouTypeFormatter","DIGIT_PLACEHOLDER","AsYouTypeParser","extractFormattedDigitsAndPlus","getCountryByCallingCode","getCountryByNationalNumber","isObject","USE_NON_GEOGRAPHIC_COUNTRY_CODE","AsYouType","optionsOrDefaultCountry","metadata","_classCallCheck","_this$getCountryAndCa","getCountryAndCallingCode","_this$getCountryAndCa2","_slicedToArray","defaultCountry","defaultCallingCode","reset","_createClass","key","value","hasCountry","undefined","isNonGeographicCallingCode","input","text","_this$parser$input","parser","state","digits","justLeadingPlus","formattedOutput","determineTheCountryIfNeeded","nationalSignificantNumber","formatter","narrowDownMatchingFormats","formattedNationalNumber","hasSelectedNumberingPlan","format","reExtractNationalSignificantNumber","nationalDigits","getNationalDigits","getFullNumber","getNonFormattedNumber","_this","onCountryChange","country","onCallingCodeChange","callingCode","selectNumberingPlan","numberingPlan","onNationalSignificantNumberChange","isInternational","international","getCallingCode","getCountryCallingCode","getCountry","_getCountry","isCountryCallingCodeAmbiguous","determineTheCountry","_this2","prefix","getInternationalPrefixBeforeCountryCallingCode","spacing","concat","getDigitsWithoutInternationalPrefix","getNonFormattedNationalNumberWithPrefix","_this$state","prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix","nationalPrefix","number","nationalSignificantNumberIsModified","getNonFormattedTemplate","replace","countryCodes","getCountryCodesForCallingCode","length","nationalNumber","setCountry","getNumberValue","_this$state2","callingCode_","countryCallingCode","getNumber","_this$state3","carrierCode","exactCountry","getExactCountryForMultiCountryCallingCode","phoneNumber","isPossible","isValid","validateLength","_this$state4","result","getNationalNumber","getChars","getTemplate","default","ambiguousCountries"],"sources":["../source/AsYouType.js"],"sourcesContent":["import Metadata from './metadata.js'\r\nimport PhoneNumber from './PhoneNumber.js'\r\nimport checkNumberLength from './helpers/checkNumberLength.js'\r\nimport AsYouTypeState from './AsYouTypeState.js'\r\nimport AsYouTypeFormatter, { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.js'\r\nimport AsYouTypeParser, { extractFormattedDigitsAndPlus } from './AsYouTypeParser.js'\r\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode.js'\r\nimport getCountryByNationalNumber from './helpers/getCountryByNationalNumber.js'\r\nimport isObject from './helpers/isObject.js'\r\n\r\nconst USE_NON_GEOGRAPHIC_COUNTRY_CODE = false\r\n\r\nexport default class AsYouType {\r\n\t/**\r\n\t * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.\r\n\t * @param {Object} metadata\r\n\t */\r\n\tconstructor(optionsOrDefaultCountry, metadata) {\r\n\t\t// Metadata instance is created once and stays constant.\r\n\t\t// This is required because other utility classes such as `AsYouTypeFormatter`\r\n\t\t// will use this metadata instance \"reference\" and will assume that it stays constant.\r\n\t\tthis.metadata = new Metadata(metadata)\r\n\t\tconst [defaultCountry, defaultCallingCode] = this.getCountryAndCallingCode(optionsOrDefaultCountry)\r\n\t\t// `this.defaultCountry` and `this.defaultCallingCode` aren't required to be in sync.\r\n\t\t// For example, `this.defaultCountry` could be `\"AR\"` and `this.defaultCallingCode` could be `undefined`.\r\n\t\t// So `this.defaultCountry` and `this.defaultCallingCode` are totally independent.\r\n\t\tthis.defaultCountry = defaultCountry\r\n\t\tthis.defaultCallingCode = defaultCallingCode\r\n\t\tthis.reset()\r\n\t}\r\n\r\n\tgetCountryAndCallingCode(optionsOrDefaultCountry) {\r\n\t\t// Set `defaultCountry` and `defaultCallingCode` options.\r\n\t\tlet defaultCountry\r\n\t\tlet defaultCallingCode\r\n\t\t// Turns out `null` also has type \"object\". Weird.\r\n\t\tif (optionsOrDefaultCountry) {\r\n\t\t\tif (isObject(optionsOrDefaultCountry)) {\r\n\t\t\t\tdefaultCountry = optionsOrDefaultCountry.defaultCountry\r\n\t\t\t\tdefaultCallingCode = optionsOrDefaultCountry.defaultCallingCode\r\n\t\t\t} else {\r\n\t\t\t\tdefaultCountry = optionsOrDefaultCountry\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {\r\n\t\t\tdefaultCountry = undefined\r\n\t\t}\r\n\t\tif (defaultCallingCode) {\r\n\t\t\t/* istanbul ignore if */\r\n\t\t\tif (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\r\n\t\t\t\tif (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {\r\n\t\t\t\t\tdefaultCountry = '001'\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn [defaultCountry, defaultCallingCode]\r\n\t}\r\n\r\n\t/**\r\n\t * Inputs \"next\" phone number characters.\r\n\t * @param {string} text\r\n\t * @return {string} Formatted phone number characters that have been input so far.\r\n\t */\r\n\tinput(text) {\r\n\t\tconst {\r\n\t\t\tdigits,\r\n\t\t\tjustLeadingPlus\r\n\t\t} = this.parser.input(text, this.state)\r\n\t\tif (justLeadingPlus) {\r\n\t\t\tthis.formattedOutput = '+'\r\n\t\t} else if (digits) {\r\n\t\t\tthis.determineTheCountryIfNeeded()\r\n\t\t\t// Match the available formats by the currently available leading digits.\r\n\t\t\tif (this.state.nationalSignificantNumber) {\r\n\t\t\t\tthis.formatter.narrowDownMatchingFormats(this.state)\r\n\t\t\t}\r\n\t\t\tlet formattedNationalNumber\r\n\t\t\tif (this.metadata.hasSelectedNumberingPlan()) {\r\n\t\t\t\tformattedNationalNumber = this.formatter.format(digits, this.state)\r\n\t\t\t}\r\n\t\t\tif (formattedNationalNumber === undefined) {\r\n\t\t\t\t// See if another national (significant) number could be re-extracted.\r\n\t\t\t\tif (this.parser.reExtractNationalSignificantNumber(this.state)) {\r\n\t\t\t\t\tthis.determineTheCountryIfNeeded()\r\n\t\t\t\t\t// If it could, then re-try formatting the new national (significant) number.\r\n\t\t\t\t\tconst nationalDigits = this.state.getNationalDigits()\r\n\t\t\t\t\tif (nationalDigits) {\r\n\t\t\t\t\t\tformattedNationalNumber = this.formatter.format(nationalDigits, this.state)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.formattedOutput = formattedNationalNumber\r\n\t\t\t\t? this.getFullNumber(formattedNationalNumber)\r\n\t\t\t\t: this.getNonFormattedNumber()\r\n\t\t}\r\n\t\treturn this.formattedOutput\r\n\t}\r\n\r\n\treset() {\r\n\t\tthis.state = new AsYouTypeState({\r\n\t\t\tonCountryChange: (country) => {\r\n\t\t\t\t// Before version `1.6.0`, the official `AsYouType` formatter API\r\n\t\t\t\t// included a `.country` property on an `AsYouType` instance.\r\n\t\t\t\t// Since that property (along with the others) have been moved to\r\n\t\t\t\t// `this.state`, `this.country` property is emulated for compatibility\r\n\t\t\t\t// with the old versions.\r\n\t\t\t\tthis.country = country\r\n\t\t\t},\r\n\t\t\tonCallingCodeChange: (callingCode, country) => {\r\n\t\t\t\tthis.metadata.selectNumberingPlan(country || callingCode)\r\n\t\t\t\tthis.formatter.reset(this.metadata.numberingPlan, this.state)\r\n\t\t\t\tthis.parser.reset(this.metadata.numberingPlan)\r\n\t\t\t}\r\n\t\t})\r\n\t\tthis.formatter = new AsYouTypeFormatter({\r\n\t\t\tstate: this.state,\r\n\t\t\tmetadata: this.metadata\r\n\t\t})\r\n\t\tthis.parser = new AsYouTypeParser({\r\n\t\t\tdefaultCountry: this.defaultCountry,\r\n\t\t\tdefaultCallingCode: this.defaultCallingCode,\r\n\t\t\tmetadata: this.metadata,\r\n\t\t\tstate: this.state,\r\n\t\t\tonNationalSignificantNumberChange: () => {\r\n\t\t\t\tthis.determineTheCountryIfNeeded()\r\n\t\t\t\tthis.formatter.reset(this.metadata.numberingPlan, this.state)\r\n\t\t\t}\r\n\t\t})\r\n\t\tthis.state.reset({\r\n\t\t\tcountry: this.defaultCountry,\r\n\t\t\tcallingCode: this.defaultCallingCode\r\n\t\t})\r\n\t\tthis.formattedOutput = ''\r\n\t\treturn this\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if the phone number is being input in international format.\r\n\t * In other words, returns `true` if and only if the parsed phone number starts with a `\"+\"`.\r\n\t * @return {boolean}\r\n\t */\r\n\tisInternational() {\r\n\t\treturn this.state.international\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the \"calling code\" part of the phone number when it's being input\r\n\t * in an international format.\r\n\t * If no valid calling code has been entered so far, returns `undefined`.\r\n\t * @return {string} [callingCode]\r\n\t */\r\n\tgetCallingCode() {\r\n\t\t // If the number is being input in national format and some \"default calling code\"\r\n\t\t // has been passed to `AsYouType` constructor, then `this.state.callingCode`\r\n\t\t // is equal to that \"default calling code\".\r\n\t\t //\r\n\t\t // If the number is being input in national format and no \"default calling code\"\r\n\t\t // has been passed to `AsYouType` constructor, then returns `undefined`,\r\n\t\t // even if a \"default country\" has been passed to `AsYouType` constructor.\r\n\t\t //\r\n\t\tif (this.isInternational()) {\r\n\t\t\treturn this.state.callingCode\r\n\t\t}\r\n\t}\r\n\r\n\t// A legacy alias.\r\n\tgetCountryCallingCode() {\r\n\t\treturn this.getCallingCode()\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a two-letter country code of the phone number.\r\n\t * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n\t * Returns `undefined` if no phone number has been input yet.\r\n\t * @return {string} [country]\r\n\t */\r\n\tgetCountry() {\r\n\t\tconst { digits } = this.state\r\n\t\t// Return `undefined` if no digits have been input yet.\r\n\t\tif (digits) {\r\n\t\t\treturn this._getCountry()\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a two-letter country code of the phone number.\r\n\t * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n\t * @return {string} [country]\r\n\t */\r\n\t_getCountry() {\r\n\t\tconst { country } = this.state\r\n\t\t/* istanbul ignore if */\r\n\t\tif (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\r\n\t\t\t// `AsYouType.getCountry()` returns `undefined`\r\n\t\t\t// for \"non-geographic\" phone numbering plans.\r\n\t\t\tif (country === '001') {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn country\r\n\t}\r\n\r\n\tdetermineTheCountryIfNeeded() {\r\n\t\t// Suppose a user enters a phone number in international format,\r\n\t\t// and there're several countries corresponding to that country calling code,\r\n\t\t// and a country has been derived from the number, and then\r\n\t\t// a user enters one more digit and the number is no longer\r\n\t\t// valid for the derived country, so the country should be re-derived\r\n\t\t// on every new digit in those cases.\r\n\t\t//\r\n\t\t// If the phone number is being input in national format,\r\n\t\t// then it could be a case when `defaultCountry` wasn't specified\r\n\t\t// when creating `AsYouType` instance, and just `defaultCallingCode` was specified,\r\n\t\t// and that \"calling code\" could correspond to a \"non-geographic entity\",\r\n\t\t// or there could be several countries corresponding to that country calling code.\r\n\t\t// In those cases, `this.country` is `undefined` and should be derived\r\n\t\t// from the number. Again, if country calling code is ambiguous, then\r\n\t\t// `this.country` should be re-derived with each new digit.\r\n\t\t//\r\n\t\tif (!this.state.country || this.isCountryCallingCodeAmbiguous()) {\r\n\t\t\tthis.determineTheCountry()\r\n\t\t}\r\n\t}\r\n\r\n\t// Prepends `+CountryCode ` in case of an international phone number\r\n\tgetFullNumber(formattedNationalNumber) {\r\n\t\tif (this.isInternational()) {\r\n\t\t\tconst prefix = (text) => this.formatter.getInternationalPrefixBeforeCountryCallingCode(this.state, {\r\n\t\t\t\tspacing: text ? true : false\r\n\t\t\t}) + text\r\n\t\t\tconst { callingCode } = this.state\r\n\t\t\tif (!callingCode) {\r\n\t\t\t\treturn prefix(`${this.state.getDigitsWithoutInternationalPrefix()}`)\r\n\t\t\t}\r\n\t\t\tif (!formattedNationalNumber) {\r\n\t\t\t\treturn prefix(callingCode)\r\n\t\t\t}\r\n\t\t\treturn prefix(`${callingCode} ${formattedNationalNumber}`)\r\n\t\t}\r\n\t\treturn formattedNationalNumber\r\n\t}\r\n\r\n\tgetNonFormattedNationalNumberWithPrefix() {\r\n\t\tconst {\r\n\t\t\tnationalSignificantNumber,\r\n\t\t\tprefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,\r\n\t\t\tnationalPrefix\r\n\t\t} = this.state\r\n\t\tlet number = nationalSignificantNumber\r\n\t\tconst prefix = prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix || nationalPrefix\r\n\t\tif (prefix) {\r\n\t\t\tnumber = prefix + number\r\n\t\t}\r\n\t\treturn number\r\n\t}\r\n\r\n\tgetNonFormattedNumber() {\r\n\t\tconst { nationalSignificantNumberIsModified } = this.state\r\n\t\treturn this.getFullNumber(\r\n\t\t\tnationalSignificantNumberIsModified\r\n\t\t\t\t? this.state.getNationalDigits()\r\n\t\t\t\t: this.getNonFormattedNationalNumberWithPrefix()\r\n\t\t)\r\n\t}\r\n\r\n\tgetNonFormattedTemplate() {\r\n\t\tconst number = this.getNonFormattedNumber()\r\n\t\tif (number) {\r\n\t\t\treturn number.replace(/[\\+\\d]/g, DIGIT_PLACEHOLDER)\r\n\t\t}\r\n\t}\r\n\r\n\tisCountryCallingCodeAmbiguous() {\r\n\t\tconst { callingCode } = this.state\r\n\t\tconst countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode)\r\n\t\treturn countryCodes && countryCodes.length > 1\r\n\t}\r\n\r\n\t// Determines the exact country of the phone number\r\n\t// entered so far based on the country phone code\r\n\t// and the national phone number.\r\n\tdetermineTheCountry() {\r\n\t\t// Get a more precise country code for this national number.\r\n\t\t// It is possible that the precise country couldn't be determined\r\n\t\t// in cases when there're multiple countries sharing the same calling code.\r\n\t\t// In that case, `country` will be `undefined`.\r\n\t\tconst country = getCountryByCallingCode(\r\n\t\t\tthis.isInternational() ? this.state.callingCode : this.defaultCallingCode,\r\n\t\t\t{\r\n\t\t\t\tnationalNumber: this.state.nationalSignificantNumber,\r\n\t\t\t\tmetadata: this.metadata\r\n\t\t\t}\r\n\t\t)\r\n\t\t// If the derived country is indeed more precise,\r\n\t\t// or if no country could be derived for the updated phone number.\r\n\t\tif (country !== this.state.country) {\r\n\t\t\t// Set (or reset) the more precise country.\r\n\t\t\tthis.state.setCountry(country)\r\n\t\t\t// If a more precise country could be derived.\r\n\t\t\tif (country) {\r\n\t\t\t\t// Select a more precise telephone numbering plan.\r\n\t\t\t\t// For example, consider that `AsYouType` instance was created with `defaultCountry: \"US\"` argument.\r\n\t\t\t\t// In that case, the metadata instance will be using \"US\" metadata.\r\n\t\t\t\t// But then the user could input a Canadian phone number, in which case\r\n\t\t\t\t// the metadata instance should be switched to Canadian telephone numbering plan.\r\n\t\t\t\t// It is required to do that because later `canFormatCompleteNumber()` function will be called,\r\n\t\t\t\t// and that function relies on the precise country being pre-selected in the metadata instance.\r\n\t\t\t\t// Or, for example, `checkNumberLength()` function also relies on same thing.\r\n\t\t\t\tthis.metadata.selectNumberingPlan(country)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a E.164 phone number value for the user's input.\r\n\t *\r\n\t * For example, for country `\"US\"` and input `\"(222) 333-4444\"`\r\n\t * it will return `\"+12223334444\"`.\r\n\t *\r\n\t * For international phone number input, it will also auto-correct\r\n\t * some minor errors such as using a national prefix when writing\r\n\t * an international phone number. For example, if the user inputs\r\n\t * `\"+44 0 7400 000000\"` then it will return an auto-corrected\r\n\t * `\"+447400000000\"` phone number value.\r\n\t *\r\n\t * Will return `undefined` if no digits have been input,\r\n\t * or when inputting a phone number in national format and no\r\n\t * default country or default \"country calling code\" have been set.\r\n\t *\r\n\t * @return {string} [value]\r\n\t */\r\n\tgetNumberValue() {\r\n\t\tconst {\r\n\t\t\tdigits,\r\n\t\t\tcallingCode,\r\n\t\t\tcountry,\r\n\t\t\tnationalSignificantNumber\r\n\t\t} = this.state\r\n\r\n\t \t// Will return `undefined` if no digits have been input.\r\n\t\tif (!digits) {\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tif (this.isInternational()) {\r\n\t\t\tif (callingCode) {\r\n\t\t\t\treturn '+' + callingCode + nationalSignificantNumber\r\n\t\t\t} else {\r\n\t\t\t\treturn '+' + digits\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (country || callingCode) {\r\n\t\t\t\tconst callingCode_ = country ? this.metadata.countryCallingCode() : callingCode\r\n\t\t\t\treturn '+' + callingCode_ + nationalSignificantNumber\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an instance of `PhoneNumber` class.\r\n\t * Will return `undefined` if no national (significant) number\r\n\t * digits have been entered so far, or if no `defaultCountry` has been\r\n\t * set and the user enters a phone number not in international format.\r\n\t */\r\n\tgetNumber() {\r\n\t\tconst {\r\n\t\t\tnationalSignificantNumber,\r\n\t\t\tcarrierCode,\r\n\t\t\tcallingCode\r\n\t\t} = this.state\r\n\r\n\t\tif (!nationalSignificantNumber) {\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\t// `this._getCountry()` is basically same as `this.state.country`\r\n\t\t// with the only change that it returns `undefined` in case of a\r\n\t\t// \"non-geographic\" numbering plan instead of `\"001\"` \"internal use\" value.\r\n\t\tlet country = this._getCountry()\r\n\r\n\t\t// Sidenote:\r\n\t\t// `state.callingCode` and `state.country` are somewhat independent from one another\r\n\t\t// and there could be situations when one is defined but the other is not.\r\n\t\t// See the comment in `AsYouTypeState.js` for more info on when that is possible.\r\n\r\n\t\tif (!country && !callingCode) {\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\t// By default, if `defaultCountry` parameter was passed when\r\n\t\t// creating `AsYouType` instance, `state.country` is gonna be\r\n\t\t// that `defaultCountry`, which doesn't entirely conform with\r\n\t\t// `parsePhoneNumber()`'s behavior where it attempts to determine\r\n\t\t// the country more precisely in cases when multiple countries\r\n\t\t// could correspond to the same `countryCallingCode`.\r\n\t\t// https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103#note_1417192969\r\n\t\t//\r\n\t\t// Because `AsYouType.getNumber()` method is supposed to be a 1:1\r\n\t\t// equivalent for `parsePhoneNumber(AsYouType.getNumberValue())`,\r\n\t\t// it means that it should also behave accordingly in such cases of `country` ambiguity.\r\n\t\t// That's how users of this library would expect it to behave anyway.\r\n\t\t//\r\n\t\t// So here it checks if `state.country` is same as the `defaultCountry`,\r\n\t\t// and if it is, it attempts to get rid of any potential ambiguity.\r\n\t\t//\r\n\t\tif (country) {\r\n\t\t\tif (country === this.defaultCountry) {\r\n\t\t\t\t// // Create a `Metadata` instance just to get the calling code of the `country`.\r\n\t\t\t\t// const metadata = new Metadata(this.metadata.metadata)\r\n\t\t\t\t// // `state.callingCode` and `state.country` are somewhat independent from one another\r\n\t\t\t\t// // and there could be situations when one is defined but the other is not.\r\n\t\t\t\t// // See the comment in `AsYouTypeState.js` for more info on when that is possible.\r\n\t\t\t\t// // Here, it only passes `state.country` because there's no need to pass `state.callingCode`\r\n\t\t\t\t// // because `state.country` is known to be defined.\r\n\t\t\t\t// metadata.selectNumberingPlan(country)\r\n\t\t\t\t// const countryCallingCode = metadata.numberingPlan.callingCode()\r\n\r\n\t\t\t\t// Instead of getting `countryCallingCode` value above,\r\n\t\t\t\t// it could simply read it from the existing metadata instance.\r\n\t\t\t\tconst countryCallingCode = this.metadata.numberingPlan.callingCode()\r\n\r\n\t\t\t\t// Attempt to rule out any potential country code ambiguity, if present.\r\n\t\t\t\tconst exactCountry = getExactCountryForMultiCountryCallingCode(\r\n\t\t\t\t\tcountryCallingCode,\r\n\t\t\t\t\tnationalSignificantNumber,\r\n\t\t\t\t\tthis.metadata\r\n\t\t\t\t)\r\n\t\t\t\tif (exactCountry) {\r\n\t\t\t\t\tcountry = exactCountry\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst phoneNumber = new PhoneNumber(\r\n\t\t\tcountry || callingCode,\r\n\t\t\tnationalSignificantNumber,\r\n\t\t\tthis.metadata.metadata\r\n\t\t)\r\n\t\tif (carrierCode) {\r\n\t\t\tphoneNumber.carrierCode = carrierCode\r\n\t\t}\r\n\t\t// Phone number extensions are not supported by \"As You Type\" formatter.\r\n\t\treturn phoneNumber\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if the phone number is \"possible\".\r\n\t * Is just a shortcut for `PhoneNumber.isPossible()`.\r\n\t * @return {boolean}\r\n\t */\r\n\tisPossible() {\r\n\t\tconst phoneNumber = this.getNumber()\r\n\t\tif (!phoneNumber) {\r\n\t\t\treturn false\r\n\t\t}\r\n\t\treturn phoneNumber.isPossible()\r\n\t}\r\n\r\n\t/**\r\n\t * Returns `true` if the phone number is \"valid\".\r\n\t * Is just a shortcut for `PhoneNumber.isValid()`.\r\n\t * @return {boolean}\r\n\t */\r\n\tisValid() {\r\n\t\tconst phoneNumber = this.getNumber()\r\n\t\tif (!phoneNumber) {\r\n\t\t\treturn false\r\n\t\t}\r\n\t\treturn phoneNumber.isValid()\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if the phone number length is valid.\r\n\t * If it is, nothing is returned.\r\n\t * Otherwise, a rejection reason is returned.\r\n\t * @return {string?}\r\n\t */\r\n\tvalidateLength() {\r\n\t\tconst {\r\n\t\t\tdigits,\r\n\t\t\tnationalSignificantNumber\r\n\t\t} = this.state\r\n\r\n\t\tif (!digits) {\r\n\t\t\treturn 'NOT_A_NUMBER'\r\n\t\t}\r\n\r\n\t\tif (!this.metadata.numberingPlan) {\r\n\t\t\treturn 'INVALID_COUNTRY'\r\n\t\t}\r\n\r\n\t\tif (!nationalSignificantNumber) {\r\n\t\t\t return 'TOO_SHORT'\r\n\t\t}\r\n\r\n\t\t// `state.callingCode` and `state.country` are somewhat independent from one another\r\n\t\t// and there could be situations when one is defined but the other is not.\r\n\t\t// See the comment in `AsYouTypeState.js` for more info on when that is possible.\r\n\t\t// Here, it uses both: if `country` is defined then it will use that,\r\n\t\t// otherwise it will use `callingCode`.\r\n\t\tconst result = checkNumberLength(nationalSignificantNumber, undefined, this.metadata)\r\n\t\tif (result !== 'IS_POSSIBLE') {\r\n\t\t\treturn result\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @deprecated\r\n\t * This method is used in `react-phone-number-input/source/input-control.js`\r\n\t * in versions before `3.0.16`.\r\n\t */\r\n\tgetNationalNumber() {\r\n\t\treturn this.state.nationalSignificantNumber\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the phone number characters entered by the user.\r\n\t * @return {string}\r\n\t */\r\n\tgetChars() {\r\n\t\treturn (this.state.international ? '+' : '') + this.state.digits\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the template for the formatted phone number.\r\n\t * @return {string}\r\n\t */\r\n\tgetTemplate() {\r\n\t\treturn this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || ''\r\n\t}\r\n}\r\n\r\n// In situations when multiple countries use the same calling code,\r\n// this function tells what exact country does a given national (significant) number belong to.\r\nfunction getExactCountryForMultiCountryCallingCode(callingCode, nationalSignificantNumber, metadata) {\r\n\tconst ambiguousCountries = metadata.getCountryCodesForCallingCode(callingCode)\r\n\tif (ambiguousCountries.length > 1) {\r\n\t\treturn getCountryByNationalNumber(nationalSignificantNumber, ambiguousCountries, metadata.metadata)\r\n\t}\r\n}"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,QAAQ,MAAM,eAAe;AACpC,OAAOC,WAAW,MAAM,kBAAkB;AAC1C,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,OAAOC,cAAc,MAAM,qBAAqB;AAChD,OAAOC,kBAAkB,IAAIC,iBAAiB,QAAQ,yBAAyB;AAC/E,OAAOC,eAAe,IAAIC,6BAA6B,QAAQ,sBAAsB;AACrF,OAAOC,uBAAuB,MAAM,sCAAsC;AAC1E,OAAOC,0BAA0B,MAAM,yCAAyC;AAChF,OAAOC,QAAQ,MAAM,uBAAuB;AAE5C,IAAMC,+BAA+B,GAAG,KAAK;AAAA,IAExBC,SAAS;EAC7B;AACD;AACA;AACA;EACC,SAAAA,UAAYC,uBAAuB,EAAEC,QAAQ,EAAE;IAAAC,eAAA,OAAAH,SAAA;IAC9C;IACA;IACA;IACA,IAAI,CAACE,QAAQ,GAAG,IAAId,QAAQ,CAACc,QAAQ,CAAC;IACtC,IAAAE,qBAAA,GAA6C,IAAI,CAACC,wBAAwB,CAACJ,uBAAuB,CAAC;MAAAK,sBAAA,GAAAC,cAAA,CAA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;IAAAC,KAAA,EAIA,SAAA4E,WAAWA,CAAA,EAAG;MACb,OAAO,IAAI,CAAC9D,SAAS,CAAC8D,WAAW,CAAC,IAAI,CAACpE,KAAK,CAAC,IAAI,IAAI,CAAC4C,uBAAuB,CAAC,CAAC,IAAI,EAAE;IACtF;EAAC;AAAA,KAGF;AACA;AAAA,SAzgBqBjE,SAAS,IAAA0F,OAAA;AA0gB9B,SAASV,yCAAyCA,CAACvC,WAAW,EAAEf,yBAAyB,EAAExB,QAAQ,EAAE;EACpG,IAAMyF,kBAAkB,GAAGzF,QAAQ,CAACkE,6BAA6B,CAAC3B,WAAW,CAAC;EAC9E,IAAIkD,kBAAkB,CAACtB,MAAM,GAAG,CAAC,EAAE;IAClC,OAAOxE,0BAA0B,CAAC6B,yBAAyB,EAAEiE,kBAAkB,EAAEzF,QAAQ,CAACA,QAAQ,CAAC;EACpG;AACD","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"AsYouType.js","names":["Metadata","PhoneNumber","checkNumberLength","AsYouTypeState","AsYouTypeFormatter","DIGIT_PLACEHOLDER","AsYouTypeParser","extractFormattedDigitsAndPlus","getCountryByCallingCode","getCountryByNationalNumber","isObject","USE_NON_GEOGRAPHIC_COUNTRY_CODE","AsYouType","optionsOrDefaultCountry","metadata","_classCallCheck","_this$getCountryAndCa","getCountryAndCallingCode","_this$getCountryAndCa2","_slicedToArray","defaultCountry","defaultCallingCode","reset","_createClass","key","value","hasCountry","undefined","isNonGeographicCallingCode","input","text","_this$parser$input","parser","state","digits","justLeadingPlus","formattedOutput","determineTheCountryIfNeeded","nationalSignificantNumber","formatter","narrowDownMatchingFormats","formattedNationalNumber","hasSelectedNumberingPlan","format","reExtractNationalSignificantNumber","nationalDigits","getNationalDigits","getFullNumber","getNonFormattedNumber","_this","onCountryChange","country","onCallingCodeChange","callingCode","selectNumberingPlan","numberingPlan","onNationalSignificantNumberChange","isInternational","international","getCallingCode","getCountryCallingCode","getCountry","_getCountry","isCountryCallingCodeAmbiguous","determineTheCountry","_this2","prefix","getInternationalPrefixBeforeCountryCallingCode","spacing","concat","getDigitsWithoutInternationalPrefix","getNonFormattedNationalNumberWithPrefix","_this$state","prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix","nationalPrefix","number","nationalSignificantNumberIsModified","getNonFormattedTemplate","replace","countryCodes","getCountryCodesForCallingCode","length","nationalNumber","setCountry","getNumberValue","_this$state2","callingCode_","countryCallingCode","getNumber","_this$state3","carrierCode","exactCountry","getExactCountryForMultiCountryCallingCode","phoneNumber","isPossible","isValid","validateLength","_this$state4","result","getNationalNumber","getChars","getTemplate","default","ambiguousCountries"],"sources":["../source/AsYouType.js"],"sourcesContent":["import Metadata from './metadata.js'\nimport PhoneNumber from './PhoneNumber.js'\nimport checkNumberLength from './helpers/checkNumberLength.js'\nimport AsYouTypeState from './AsYouTypeState.js'\nimport AsYouTypeFormatter, { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.js'\nimport AsYouTypeParser, { extractFormattedDigitsAndPlus } from './AsYouTypeParser.js'\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode.js'\nimport getCountryByNationalNumber from './helpers/getCountryByNationalNumber.js'\nimport isObject from './helpers/isObject.js'\n\nconst USE_NON_GEOGRAPHIC_COUNTRY_CODE = false\n\nexport default class AsYouType {\n\t/**\n\t * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.\n\t * @param {Object} metadata\n\t */\n\tconstructor(optionsOrDefaultCountry, metadata) {\n\t\t// Metadata instance is created once and stays constant.\n\t\t// This is required because other utility classes such as `AsYouTypeFormatter`\n\t\t// will use this metadata instance \"reference\" and will assume that it stays constant.\n\t\tthis.metadata = new Metadata(metadata)\n\t\tconst [defaultCountry, defaultCallingCode] = this.getCountryAndCallingCode(optionsOrDefaultCountry)\n\t\t// `this.defaultCountry` and `this.defaultCallingCode` aren't required to be in sync.\n\t\t// For example, `this.defaultCountry` could be `\"AR\"` and `this.defaultCallingCode` could be `undefined`.\n\t\t// So `this.defaultCountry` and `this.defaultCallingCode` are totally independent.\n\t\tthis.defaultCountry = defaultCountry\n\t\tthis.defaultCallingCode = defaultCallingCode\n\t\tthis.reset()\n\t}\n\n\tgetCountryAndCallingCode(optionsOrDefaultCountry) {\n\t\t// Set `defaultCountry` and `defaultCallingCode` options.\n\t\tlet defaultCountry\n\t\tlet defaultCallingCode\n\t\t// Turns out `null` also has type \"object\". Weird.\n\t\tif (optionsOrDefaultCountry) {\n\t\t\tif (isObject(optionsOrDefaultCountry)) {\n\t\t\t\tdefaultCountry = optionsOrDefaultCountry.defaultCountry\n\t\t\t\tdefaultCallingCode = optionsOrDefaultCountry.defaultCallingCode\n\t\t\t} else {\n\t\t\t\tdefaultCountry = optionsOrDefaultCountry\n\t\t\t}\n\t\t}\n\t\tif (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {\n\t\t\tdefaultCountry = undefined\n\t\t}\n\t\tif (defaultCallingCode) {\n\t\t\t/* istanbul ignore if */\n\t\t\tif (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n\t\t\t\tif (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {\n\t\t\t\t\tdefaultCountry = '001'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn [defaultCountry, defaultCallingCode]\n\t}\n\n\t/**\n\t * Inputs \"next\" phone number characters.\n\t * @param {string} text\n\t * @return {string} Formatted phone number characters that have been input so far.\n\t */\n\tinput(text) {\n\t\tconst {\n\t\t\tdigits,\n\t\t\tjustLeadingPlus\n\t\t} = this.parser.input(text, this.state)\n\t\tif (justLeadingPlus) {\n\t\t\tthis.formattedOutput = '+'\n\t\t} else if (digits) {\n\t\t\tthis.determineTheCountryIfNeeded()\n\t\t\t// Match the available formats by the currently available leading digits.\n\t\t\tif (this.state.nationalSignificantNumber) {\n\t\t\t\tthis.formatter.narrowDownMatchingFormats(this.state)\n\t\t\t}\n\t\t\tlet formattedNationalNumber\n\t\t\tif (this.metadata.hasSelectedNumberingPlan()) {\n\t\t\t\tformattedNationalNumber = this.formatter.format(digits, this.state)\n\t\t\t}\n\t\t\tif (formattedNationalNumber === undefined) {\n\t\t\t\t// See if another national (significant) number could be re-extracted.\n\t\t\t\tif (this.parser.reExtractNationalSignificantNumber(this.state)) {\n\t\t\t\t\tthis.determineTheCountryIfNeeded()\n\t\t\t\t\t// If it could, then re-try formatting the new national (significant) number.\n\t\t\t\t\tconst nationalDigits = this.state.getNationalDigits()\n\t\t\t\t\tif (nationalDigits) {\n\t\t\t\t\t\tformattedNationalNumber = this.formatter.format(nationalDigits, this.state)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.formattedOutput = formattedNationalNumber\n\t\t\t\t? this.getFullNumber(formattedNationalNumber)\n\t\t\t\t: this.getNonFormattedNumber()\n\t\t}\n\t\treturn this.formattedOutput\n\t}\n\n\treset() {\n\t\tthis.state = new AsYouTypeState({\n\t\t\tonCountryChange: (country) => {\n\t\t\t\t// Before version `1.6.0`, the official `AsYouType` formatter API\n\t\t\t\t// included a `.country` property on an `AsYouType` instance.\n\t\t\t\t// Since that property (along with the others) have been moved to\n\t\t\t\t// `this.state`, `this.country` property is emulated for compatibility\n\t\t\t\t// with the old versions.\n\t\t\t\tthis.country = country\n\t\t\t},\n\t\t\tonCallingCodeChange: (callingCode, country) => {\n\t\t\t\tthis.metadata.selectNumberingPlan(country || callingCode)\n\t\t\t\tthis.formatter.reset(this.metadata.numberingPlan, this.state)\n\t\t\t\tthis.parser.reset(this.metadata.numberingPlan)\n\t\t\t}\n\t\t})\n\t\tthis.formatter = new AsYouTypeFormatter({\n\t\t\tstate: this.state,\n\t\t\tmetadata: this.metadata\n\t\t})\n\t\tthis.parser = new AsYouTypeParser({\n\t\t\tdefaultCountry: this.defaultCountry,\n\t\t\tdefaultCallingCode: this.defaultCallingCode,\n\t\t\tmetadata: this.metadata,\n\t\t\tstate: this.state,\n\t\t\tonNationalSignificantNumberChange: () => {\n\t\t\t\tthis.determineTheCountryIfNeeded()\n\t\t\t\tthis.formatter.reset(this.metadata.numberingPlan, this.state)\n\t\t\t}\n\t\t})\n\t\tthis.state.reset({\n\t\t\tcountry: this.defaultCountry,\n\t\t\tcallingCode: this.defaultCallingCode\n\t\t})\n\t\tthis.formattedOutput = ''\n\t\treturn this\n\t}\n\n\t/**\n\t * Returns `true` if the phone number is being input in international format.\n\t * In other words, returns `true` if and only if the parsed phone number starts with a `\"+\"`.\n\t * @return {boolean}\n\t */\n\tisInternational() {\n\t\treturn this.state.international\n\t}\n\n\t/**\n\t * Returns the \"calling code\" part of the phone number when it's being input\n\t * in an international format.\n\t * If no valid calling code has been entered so far, returns `undefined`.\n\t * @return {string} [callingCode]\n\t */\n\tgetCallingCode() {\n\t\t // If the number is being input in national format and some \"default calling code\"\n\t\t // has been passed to `AsYouType` constructor, then `this.state.callingCode`\n\t\t // is equal to that \"default calling code\".\n\t\t //\n\t\t // If the number is being input in national format and no \"default calling code\"\n\t\t // has been passed to `AsYouType` constructor, then returns `undefined`,\n\t\t // even if a \"default country\" has been passed to `AsYouType` constructor.\n\t\t //\n\t\tif (this.isInternational()) {\n\t\t\treturn this.state.callingCode\n\t\t}\n\t}\n\n\t// A legacy alias.\n\tgetCountryCallingCode() {\n\t\treturn this.getCallingCode()\n\t}\n\n\t/**\n\t * Returns a two-letter country code of the phone number.\n\t * Returns `undefined` for \"non-geographic\" phone numbering plans.\n\t * Returns `undefined` if no phone number has been input yet.\n\t * @return {string} [country]\n\t */\n\tgetCountry() {\n\t\tconst { digits } = this.state\n\t\t// Return `undefined` if no digits have been input yet.\n\t\tif (digits) {\n\t\t\treturn this._getCountry()\n\t\t}\n\t}\n\n\t/**\n\t * Returns a two-letter country code of the phone number.\n\t * Returns `undefined` for \"non-geographic\" phone numbering plans.\n\t * @return {string} [country]\n\t */\n\t_getCountry() {\n\t\tconst { country } = this.state\n\t\t/* istanbul ignore if */\n\t\tif (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n\t\t\t// `AsYouType.getCountry()` returns `undefined`\n\t\t\t// for \"non-geographic\" phone numbering plans.\n\t\t\tif (country === '001') {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\treturn country\n\t}\n\n\tdetermineTheCountryIfNeeded() {\n\t\t// Suppose a user enters a phone number in international format,\n\t\t// and there're several countries corresponding to that country calling code,\n\t\t// and a country has been derived from the number, and then\n\t\t// a user enters one more digit and the number is no longer\n\t\t// valid for the derived country, so the country should be re-derived\n\t\t// on every new digit in those cases.\n\t\t//\n\t\t// If the phone number is being input in national format,\n\t\t// then it could be a case when `defaultCountry` wasn't specified\n\t\t// when creating `AsYouType` instance, and just `defaultCallingCode` was specified,\n\t\t// and that \"calling code\" could correspond to a \"non-geographic entity\",\n\t\t// or there could be several countries corresponding to that country calling code.\n\t\t// In those cases, `this.country` is `undefined` and should be derived\n\t\t// from the number. Again, if country calling code is ambiguous, then\n\t\t// `this.country` should be re-derived with each new digit.\n\t\t//\n\t\tif (!this.state.country || this.isCountryCallingCodeAmbiguous()) {\n\t\t\tthis.determineTheCountry()\n\t\t}\n\t}\n\n\t// Prepends `+CountryCode ` in case of an international phone number\n\tgetFullNumber(formattedNationalNumber) {\n\t\tif (this.isInternational()) {\n\t\t\tconst prefix = (text) => this.formatter.getInternationalPrefixBeforeCountryCallingCode(this.state, {\n\t\t\t\tspacing: text ? true : false\n\t\t\t}) + text\n\t\t\tconst { callingCode } = this.state\n\t\t\tif (!callingCode) {\n\t\t\t\treturn prefix(`${this.state.getDigitsWithoutInternationalPrefix()}`)\n\t\t\t}\n\t\t\tif (!formattedNationalNumber) {\n\t\t\t\treturn prefix(callingCode)\n\t\t\t}\n\t\t\treturn prefix(`${callingCode} ${formattedNationalNumber}`)\n\t\t}\n\t\treturn formattedNationalNumber\n\t}\n\n\tgetNonFormattedNationalNumberWithPrefix() {\n\t\tconst {\n\t\t\tnationalSignificantNumber,\n\t\t\tprefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,\n\t\t\tnationalPrefix\n\t\t} = this.state\n\t\tlet number = nationalSignificantNumber\n\t\tconst prefix = prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix || nationalPrefix\n\t\tif (prefix) {\n\t\t\tnumber = prefix + number\n\t\t}\n\t\treturn number\n\t}\n\n\tgetNonFormattedNumber() {\n\t\tconst { nationalSignificantNumberIsModified } = this.state\n\t\treturn this.getFullNumber(\n\t\t\tnationalSignificantNumberIsModified\n\t\t\t\t? this.state.getNationalDigits()\n\t\t\t\t: this.getNonFormattedNationalNumberWithPrefix()\n\t\t)\n\t}\n\n\tgetNonFormattedTemplate() {\n\t\tconst number = this.getNonFormattedNumber()\n\t\tif (number) {\n\t\t\treturn number.replace(/[\\+\\d]/g, DIGIT_PLACEHOLDER)\n\t\t}\n\t}\n\n\tisCountryCallingCodeAmbiguous() {\n\t\tconst { callingCode } = this.state\n\t\tconst countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode)\n\t\treturn countryCodes && countryCodes.length > 1\n\t}\n\n\t// Determines the exact country of the phone number\n\t// entered so far based on the country phone code\n\t// and the national phone number.\n\tdetermineTheCountry() {\n\t\t// Get a more precise country code for this national number.\n\t\t// It is possible that the precise country couldn't be determined\n\t\t// in cases when there're multiple countries sharing the same calling code.\n\t\t// In that case, `country` will be `undefined`.\n\t\tconst country = getCountryByCallingCode(\n\t\t\tthis.isInternational() ? this.state.callingCode : this.defaultCallingCode,\n\t\t\t{\n\t\t\t\tnationalNumber: this.state.nationalSignificantNumber,\n\t\t\t\tmetadata: this.metadata\n\t\t\t}\n\t\t)\n\t\t// If the derived country is indeed more precise,\n\t\t// or if no country could be derived for the updated phone number.\n\t\tif (country !== this.state.country) {\n\t\t\t// Set (or reset) the more precise country.\n\t\t\tthis.state.setCountry(country)\n\t\t\t// If a more precise country could be derived.\n\t\t\tif (country) {\n\t\t\t\t// Select a more precise telephone numbering plan.\n\t\t\t\t// For example, consider that `AsYouType` instance was created with `defaultCountry: \"US\"` argument.\n\t\t\t\t// In that case, the metadata instance will be using \"US\" metadata.\n\t\t\t\t// But then the user could input a Canadian phone number, in which case\n\t\t\t\t// the metadata instance should be switched to Canadian telephone numbering plan.\n\t\t\t\t// It is required to do that because later `canFormatCompleteNumber()` function will be called,\n\t\t\t\t// and that function relies on the precise country being pre-selected in the metadata instance.\n\t\t\t\t// Or, for example, `checkNumberLength()` function also relies on same thing.\n\t\t\t\tthis.metadata.selectNumberingPlan(country)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns a E.164 phone number value for the user's input.\n\t *\n\t * For example, for country `\"US\"` and input `\"(222) 333-4444\"`\n\t * it will return `\"+12223334444\"`.\n\t *\n\t * For international phone number input, it will also auto-correct\n\t * some minor errors such as using a national prefix when writing\n\t * an international phone number. For example, if the user inputs\n\t * `\"+44 0 7400 000000\"` then it will return an auto-corrected\n\t * `\"+447400000000\"` phone number value.\n\t *\n\t * Will return `undefined` if no digits have been input,\n\t * or when inputting a phone number in national format and no\n\t * default country or default \"country calling code\" have been set.\n\t *\n\t * @return {string} [value]\n\t */\n\tgetNumberValue() {\n\t\tconst {\n\t\t\tdigits,\n\t\t\tcallingCode,\n\t\t\tcountry,\n\t\t\tnationalSignificantNumber\n\t\t} = this.state\n\n\t \t// Will return `undefined` if no digits have been input.\n\t\tif (!digits) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.isInternational()) {\n\t\t\tif (callingCode) {\n\t\t\t\treturn '+' + callingCode + nationalSignificantNumber\n\t\t\t} else {\n\t\t\t\treturn '+' + digits\n\t\t\t}\n\t\t} else {\n\t\t\tif (country || callingCode) {\n\t\t\t\tconst callingCode_ = country ? this.metadata.countryCallingCode() : callingCode\n\t\t\t\treturn '+' + callingCode_ + nationalSignificantNumber\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an instance of `PhoneNumber` class.\n\t * Will return `undefined` if no national (significant) number\n\t * digits have been entered so far, or if no `defaultCountry` has been\n\t * set and the user enters a phone number not in international format.\n\t */\n\tgetNumber() {\n\t\tconst {\n\t\t\tnationalSignificantNumber,\n\t\t\tcarrierCode,\n\t\t\tcallingCode\n\t\t} = this.state\n\n\t\tif (!nationalSignificantNumber) {\n\t\t\treturn\n\t\t}\n\n\t\t// `this._getCountry()` is basically same as `this.state.country`\n\t\t// with the only change that it returns `undefined` in case of a\n\t\t// \"non-geographic\" numbering plan instead of `\"001\"` \"internal use\" value.\n\t\tlet country = this._getCountry()\n\n\t\t// Sidenote:\n\t\t// `state.callingCode` and `state.country` are somewhat independent from one another\n\t\t// and there could be situations when one is defined but the other is not.\n\t\t// See the comment in `AsYouTypeState.js` for more info on when that is possible.\n\n\t\tif (!country && !callingCode) {\n\t\t\treturn\n\t\t}\n\n\t\t// By default, if `defaultCountry` parameter was passed when\n\t\t// creating `AsYouType` instance, `state.country` is gonna be\n\t\t// that `defaultCountry`, which doesn't entirely conform with\n\t\t// `parsePhoneNumber()`'s behavior where it attempts to determine\n\t\t// the country more precisely in cases when multiple countries\n\t\t// could correspond to the same `countryCallingCode`.\n\t\t// https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103#note_1417192969\n\t\t//\n\t\t// Because `AsYouType.getNumber()` method is supposed to be a 1:1\n\t\t// equivalent for `parsePhoneNumber(AsYouType.getNumberValue())`,\n\t\t// it means that it should also behave accordingly in such cases of `country` ambiguity.\n\t\t// That's how users of this library would expect it to behave anyway.\n\t\t//\n\t\t// So here it checks if `state.country` is same as the `defaultCountry`,\n\t\t// and if it is, it attempts to get rid of any potential ambiguity.\n\t\t//\n\t\tif (country) {\n\t\t\tif (country === this.defaultCountry) {\n\t\t\t\t// // Create a `Metadata` instance just to get the calling code of the `country`.\n\t\t\t\t// const metadata = new Metadata(this.metadata.metadata)\n\t\t\t\t// // `state.callingCode` and `state.country` are somewhat independent from one another\n\t\t\t\t// // and there could be situations when one is defined but the other is not.\n\t\t\t\t// // See the comment in `AsYouTypeState.js` for more info on when that is possible.\n\t\t\t\t// // Here, it only passes `state.country` because there's no need to pass `state.callingCode`\n\t\t\t\t// // because `state.country` is known to be defined.\n\t\t\t\t// metadata.selectNumberingPlan(country)\n\t\t\t\t// const countryCallingCode = metadata.numberingPlan.callingCode()\n\n\t\t\t\t// Instead of getting `countryCallingCode` value above,\n\t\t\t\t// it could simply read it from the existing metadata instance.\n\t\t\t\tconst countryCallingCode = this.metadata.numberingPlan.callingCode()\n\n\t\t\t\t// Attempt to rule out any potential country code ambiguity, if present.\n\t\t\t\tconst exactCountry = getExactCountryForMultiCountryCallingCode(\n\t\t\t\t\tcountryCallingCode,\n\t\t\t\t\tnationalSignificantNumber,\n\t\t\t\t\tthis.metadata\n\t\t\t\t)\n\t\t\t\tif (exactCountry) {\n\t\t\t\t\tcountry = exactCountry\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst phoneNumber = new PhoneNumber(\n\t\t\tcountry || callingCode,\n\t\t\tnationalSignificantNumber,\n\t\t\tthis.metadata.metadata\n\t\t)\n\t\tif (carrierCode) {\n\t\t\tphoneNumber.carrierCode = carrierCode\n\t\t}\n\t\t// Phone number extensions are not supported by \"As You Type\" formatter.\n\t\treturn phoneNumber\n\t}\n\n\t/**\n\t * Returns `true` if the phone number is \"possible\".\n\t * Is just a shortcut for `PhoneNumber.isPossible()`.\n\t * @return {boolean}\n\t */\n\tisPossible() {\n\t\tconst phoneNumber = this.getNumber()\n\t\tif (!phoneNumber) {\n\t\t\treturn false\n\t\t}\n\t\treturn phoneNumber.isPossible()\n\t}\n\n\t/**\n\t * Returns `true` if the phone number is \"valid\".\n\t * Is just a shortcut for `PhoneNumber.isValid()`.\n\t * @return {boolean}\n\t */\n\tisValid() {\n\t\tconst phoneNumber = this.getNumber()\n\t\tif (!phoneNumber) {\n\t\t\treturn false\n\t\t}\n\t\treturn phoneNumber.isValid()\n\t}\n\n\t/**\n\t * Checks if the phone number length is valid.\n\t * If it is, nothing is returned.\n\t * Otherwise, a rejection reason is returned.\n\t * @return {string?}\n\t */\n\tvalidateLength() {\n\t\tconst {\n\t\t\tdigits,\n\t\t\tnationalSignificantNumber\n\t\t} = this.state\n\n\t\tif (!digits) {\n\t\t\treturn 'NOT_A_NUMBER'\n\t\t}\n\n\t\tif (!this.metadata.numberingPlan) {\n\t\t\treturn 'INVALID_COUNTRY'\n\t\t}\n\n\t\tif (!nationalSignificantNumber) {\n\t\t\t return 'TOO_SHORT'\n\t\t}\n\n\t\t// `state.callingCode` and `state.country` are somewhat independent from one another\n\t\t// and there could be situations when one is defined but the other is not.\n\t\t// See the comment in `AsYouTypeState.js` for more info on when that is possible.\n\t\t// Here, it uses both: if `country` is defined then it will use that,\n\t\t// otherwise it will use `callingCode`.\n\t\tconst result = checkNumberLength(nationalSignificantNumber, undefined, this.metadata)\n\t\tif (result !== 'IS_POSSIBLE') {\n\t\t\treturn result\n\t\t}\n\t}\n\n\t/**\n\t * @deprecated\n\t * This method is used in `react-phone-number-input/source/input-control.js`\n\t * in versions before `3.0.16`.\n\t */\n\tgetNationalNumber() {\n\t\treturn this.state.nationalSignificantNumber\n\t}\n\n\t/**\n\t * Returns the phone number characters entered by the user.\n\t * @return {string}\n\t */\n\tgetChars() {\n\t\treturn (this.state.international ? '+' : '') + this.state.digits\n\t}\n\n\t/**\n\t * Returns the template for the formatted phone number.\n\t * @return {string}\n\t */\n\tgetTemplate() {\n\t\treturn this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || ''\n\t}\n}\n\n// In situations when multiple countries use the same calling code,\n// this function tells what exact country does a given national (significant) number belong to.\nfunction getExactCountryForMultiCountryCallingCode(callingCode, nationalSignificantNumber, metadata) {\n\tconst ambiguousCountries = metadata.getCountryCodesForCallingCode(callingCode)\n\tif (ambiguousCountries.length > 1) {\n\t\treturn getCountryByNationalNumber(nationalSignificantNumber, ambiguousCountries, metadata.metadata)\n\t}\n}"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,QAAQ,MAAM,eAAe;AACpC,OAAOC,WAAW,MAAM,kBAAkB;AAC1C,OAAOC,iBAAiB,MAAM,gCAAgC;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