pixel-react 1.15.11 → 1.15.12
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/README.md +75 -75
- package/lib/ThirdPartyPackages/JanusGateway.js +5 -2
- package/lib/ThirdPartyPackages/JanusGateway.js.map +1 -1
- package/lib/_virtual/index10.js +2 -2
- package/lib/_virtual/index11.js +2 -2
- package/lib/_virtual/index12.js +2 -2
- package/lib/_virtual/index9.js +2 -2
- package/lib/assets/icons/spinner.svg.js +1 -1
- package/lib/assets/icons/spinner.svg.js.map +1 -1
- package/lib/components/Editor/VariableDropdown.js +2 -2
- package/lib/index.cjs +7209 -4574
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +1 -1
- package/lib/node_modules/@date-fns/tz/date/index.js +19 -1
- package/lib/node_modules/@date-fns/tz/date/index.js.map +1 -1
- package/lib/node_modules/@date-fns/tz/date/mini.js +6 -34
- package/lib/node_modules/@date-fns/tz/date/mini.js.map +1 -1
- package/lib/node_modules/@date-fns/tz/tzOffset/index.js +5 -6
- package/lib/node_modules/@date-fns/tz/tzOffset/index.js.map +1 -1
- package/lib/node_modules/janus-gateway/npm/dist/janus.es.js +3241 -0
- package/lib/node_modules/janus-gateway/npm/dist/janus.es.js.map +1 -0
- package/lib/node_modules/js-beautify/js/src/css/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/css/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/beautifier.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/tokenizer.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/beautifier.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/tokenizer.js +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouType.js +82 -115
- package/lib/node_modules/libphonenumber-js/es6/AsYouType.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js +58 -68
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js +23 -36
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js +9 -13
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js +187 -226
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js +27 -21
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeParser.js +117 -150
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeParser.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeState.js +38 -57
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeState.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/ParseError.js +109 -70
- package/lib/node_modules/libphonenumber-js/es6/ParseError.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/PhoneNumber.js +57 -72
- package/lib/node_modules/libphonenumber-js/es6/PhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/constants.js +9 -15
- package/lib/node_modules/libphonenumber-js/es6/constants.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/format.js +93 -67
- package/lib/node_modules/libphonenumber-js/es6/format.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.js +1 -0
- package/lib/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/getCountries.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +1 -0
- package/lib/node_modules/libphonenumber-js/es6/helpers/RFC3966.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +10 -49
- package/lib/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +32 -20
- package/lib/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +4 -5
- package/lib/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +18 -25
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +11 -12
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +11 -13
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +11 -21
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +11 -12
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +12 -15
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +4 -4
- package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +35 -59
- package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +2 -2
- package/lib/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +36 -38
- package/lib/node_modules/libphonenumber-js/es6/helpers/getNumberType.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +1 -0
- package/lib/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/isObject.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +10 -14
- package/lib/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +4 -4
- package/lib/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +27 -22
- package/lib/node_modules/libphonenumber-js/es6/helpers/parseDigits.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +6 -6
- package/lib/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/isPossible.js +7 -6
- package/lib/node_modules/libphonenumber-js/es6/isPossible.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/isValid.js +5 -6
- package/lib/node_modules/libphonenumber-js/es6/isValid.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js +26 -44
- package/lib/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/metadata.js +69 -120
- package/lib/node_modules/libphonenumber-js/es6/metadata.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/normalizeArguments.js +68 -87
- package/lib/node_modules/libphonenumber-js/es6/normalizeArguments.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/parse.js +40 -58
- package/lib/node_modules/libphonenumber-js/es6/parse.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +36 -32
- package/lib/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +26 -44
- package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +28 -46
- package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/tools/semver-compare.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/metadata.min.json.js +18 -18
- package/lib/node_modules/libphonenumber-js/metadata.min.json.js.map +1 -1
- package/lib/node_modules/prop-types/index.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/DayPicker.js +64 -88
- package/lib/node_modules/react-day-picker/dist/esm/DayPicker.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/UI.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/classes/DateLib.js +6 -71
- package/lib/node_modules/react-day-picker/dist/esm/classes/DateLib.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Button.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Chevron.js +14 -18
- package/lib/node_modules/react-day-picker/dist/esm/components/Chevron.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Day.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/DayButton.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Dropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/DropdownNav.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Footer.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Month.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/MonthCaption.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/MonthGrid.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Months.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Nav.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Option.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Root.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Select.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Week.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/WeekNumber.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Weekday.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Weekdays.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Weeks.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +2 -3
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatDay.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/index.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getComponents.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDates.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDays.js +4 -4
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDays.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getMonths.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +2 -2
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +11 -9
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/index.js +2 -2
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +2 -3
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelGrid.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelNav.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelNext.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelNext.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/selection/useMulti.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/selection/useRange.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/selection/useSingle.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useAnimation.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useAnimation.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useCalendar.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useCalendar.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useDayPicker.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useFocus.js +0 -6
- package/lib/node_modules/react-day-picker/dist/esm/useFocus.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useSelection.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/addToRange.js +1 -6
- package/lib/node_modules/react-day-picker/dist/esm/utils/addToRange.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/typeguards.js.map +1 -1
- package/lib/node_modules/react-hook-form/dist/index.esm.js +44 -67
- package/lib/node_modules/react-hook-form/dist/index.esm.js.map +1 -1
- package/lib/node_modules/react-virtuoso/dist/index.js +1200 -1246
- package/lib/node_modules/react-virtuoso/dist/index.js.map +1 -1
- package/lib/node_modules/ua-parser-js/src/ua-parser.js +71 -85
- package/lib/node_modules/ua-parser-js/src/ua-parser.js.map +1 -1
- package/lib/styles.css +1 -1
- package/lib/styles.css.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +106 -106
- package/lib/node_modules/@date-fns/tz/tzName/index.js +0 -40
- package/lib/node_modules/@date-fns/tz/tzName/index.js.map +0 -1
- package/lib/node_modules/react-day-picker/node_modules/date-fns/eachYearOfInterval.js +0 -64
- package/lib/node_modules/react-day-picker/node_modules/date-fns/eachYearOfInterval.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCountryByNationalNumber.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(
|
|
1
|
+
{"version":3,"file":"getCountryByNationalNumber.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport Metadata from '../metadata.js';\nimport getNumberType from './getNumberType.js';\nexport default function getCountryByNationalNumber(nationalPhoneNumber, _ref) {\n var countries = _ref.countries,\n defaultCountry = _ref.defaultCountry,\n metadata = _ref.metadata;\n // Re-create `metadata` because it will be selecting a `country`.\n metadata = new Metadata(metadata); // const matchingCountries = []\n\n for (var _iterator = _createForOfIteratorHelperLoose(countries), _step; !(_step = _iterator()).done;) {\n var country = _step.value;\n metadata.country(country); // \"Leading digits\" patterns are only defined for about 20% of all countries.\n // By definition, matching \"leading digits\" is a sufficient but not a necessary\n // condition for a phone number to belong to a country.\n // The point of \"leading digits\" check is that it's the fastest one to get a match.\n // https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits\n // I'd suppose that \"leading digits\" patterns are mutually exclusive for different countries\n // because of the intended use of that feature.\n\n if (metadata.leadingDigits()) {\n if (nationalPhoneNumber && nationalPhoneNumber.search(metadata.leadingDigits()) === 0) {\n return country;\n }\n } // Else perform full validation with all of those\n // fixed-line/mobile/etc regular expressions.\n else if (getNumberType({\n phone: nationalPhoneNumber,\n country: country\n }, undefined, metadata.metadata)) {\n // If both the `defaultCountry` and the \"main\" one match the phone number,\n // don't prefer the `defaultCountry` over the \"main\" one.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/154\n return country; // // If the `defaultCountry` is among the `matchingCountries` then return it.\n // if (defaultCountry) {\n // \tif (country === defaultCountry) {\n // \t\treturn country\n // \t}\n // \tmatchingCountries.push(country)\n // } else {\n // \treturn country\n // }\n }\n } // // Return the first (\"main\") one of the `matchingCountries`.\n // if (matchingCountries.length > 0) {\n // \treturn matchingCountries[0]\n // }\n\n}\n//# sourceMappingURL=getCountryByNationalNumber.js.map"],"names":["getCountryByNationalNumber","nationalPhoneNumber","_ref","countries","defaultCountry","metadata","Metadata","_iterator","_createForOfIteratorHelperLoose","_step","done","country","value","leadingDigits","search","getNumberType","phone","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGe,SAASA,0BAATA,CAAoCC,mBAApC,EAAAC,IAAA,EAIZ;AAAA,EAAA,IAHFC,SAGE,GAAAD,IAAA,CAHFC,SAGE;IAAAD,IAAA,CAFFE,cAEE;QADFC,QACE,GAAAH,IAAA,CADFG;AAEA;AACAA,EAAAA,QAAQ,GAAG,IAAIC,QAAJ,CAAaD,QAAb,CAAX,CAFE;;AAMF,EAAA,KAAA,IAAAE,SAAA,GAAAC,+BAAA,CAAsBL,SAAtB,CAAA,EAAAM,KAAA,EAAA,CAAA,CAAAA,KAAA,GAAAF,SAAA,EAAA,EAAAG,IAAA,GAAiC;AAAA,IAAA,IAAtBC,OAAsB,GAAAF,KAAA,CAAAG,KAAA;AAChCP,IAAAA,QAAQ,CAACM,OAAT,CAAiBA,OAAjB,EADgC;AAGhC;AACA;AACA;AACA;AACA;AACA;;AACA,IAAA,IAAIN,QAAQ,CAACQ,aAAT,EAAJ,EAA8B;AAC7B,MAAA,IAAIZ,mBAAmB,IACtBA,mBAAmB,CAACa,MAApB,CAA2BT,QAAQ,CAACQ,aAAT,EAA3B,CAAA,KAAyD,CAD1D,EAC6D;AAC5D,QAAA,OAAOF,OAAP;AACA,MAAA;AACD,IAAA,CALD;AAOA;SACK,IAAII,aAAa,CAAC;AAAEC,MAAAA,KAAK,EAAEf,mBAAT;AAA8BU,MAAAA,OAAO,EAAPA;AAA9B,KAAD,EAA0CM,SAA1C,EAAqDZ,QAAQ,CAACA,QAA9D,CAAjB,EAA0F;AAC9F;AACA;AACA;MACA,OAAOM,OAAP,CAJ8F;AAM9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAA;AACD,EAAA,CAtCC;AAyCF;AACA;AACA;AACA;;;;","x_google_ignoreList":[0]}
|
|
@@ -9,10 +9,10 @@ import Metadata from '../metadata.js';
|
|
|
9
9
|
* region, they will be represented as a regex string that always contains one
|
|
10
10
|
* or more characters that are not ASCII digits or a tilde.
|
|
11
11
|
*/
|
|
12
|
-
var SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
|
|
13
12
|
|
|
14
|
-
// For regions that have multiple IDD prefixes
|
|
13
|
+
var SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/; // For regions that have multiple IDD prefixes
|
|
15
14
|
// a preferred IDD prefix is returned.
|
|
15
|
+
|
|
16
16
|
function getIddPrefix(country, callingCode, metadata) {
|
|
17
17
|
var countryMetadata = new Metadata(metadata);
|
|
18
18
|
countryMetadata.selectNumberingPlan(country, callingCode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIddPrefix.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js"],"sourcesContent":["import Metadata from '../metadata.js';\n
|
|
1
|
+
{"version":3,"file":"getIddPrefix.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js"],"sourcesContent":["import Metadata from '../metadata.js';\n/**\r\n * Pattern that makes it easy to distinguish whether a region has a single\r\n * international dialing prefix or not. If a region has a single international\r\n * prefix (e.g. 011 in USA), it will be represented as a string that contains\r\n * a sequence of ASCII digits, and possibly a tilde, which signals waiting for\r\n * the tone. If there are multiple available international prefixes in a\r\n * region, they will be represented as a regex string that always contains one\r\n * or more characters that are not ASCII digits or a tilde.\r\n */\n\nvar SINGLE_IDD_PREFIX_REG_EXP = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/; // For regions that have multiple IDD prefixes\n// a preferred IDD prefix is returned.\n\nexport default function getIddPrefix(country, callingCode, metadata) {\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n\n if (countryMetadata.defaultIDDPrefix()) {\n return countryMetadata.defaultIDDPrefix();\n }\n\n if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {\n return countryMetadata.IDDPrefix();\n }\n}\n//# sourceMappingURL=getIddPrefix.js.map"],"names":["SINGLE_IDD_PREFIX_REG_EXP","getIddPrefix","country","callingCode","metadata","countryMetadata","Metadata","selectNumberingPlan","defaultIDDPrefix","test","IDDPrefix"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMA,yBAAyB,GAAG,wCAAlC;AAGA;;AACe,SAASC,YAATA,CAAsBC,OAAtB,EAA+BC,WAA/B,EAA4CC,QAA5C,EAAsD;AACpE,EAAA,IAAMC,eAAe,GAAG,IAAIC,QAAJ,CAAaF,QAAb,CAAxB;AACAC,EAAAA,eAAe,CAACE,mBAAhB,CAAoCL,OAApC,EAA6CC,WAA7C,CAAA;AACA,EAAA,IAAIE,eAAe,CAACG,gBAAhB,EAAJ,EAAwC;IACvC,OAAOH,eAAe,CAACG,gBAAhB,EAAP;AACA,EAAA;EACD,IAAIR,yBAAyB,CAACS,IAA1B,CAA+BJ,eAAe,CAACK,SAAhB,EAA/B,CAAJ,EAAiE;IAChE,OAAOL,eAAe,CAACK,SAAhB,EAAP;AACA,EAAA;AACD;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,62 +1,61 @@
|
|
|
1
1
|
import Metadata from '../metadata.js';
|
|
2
2
|
import matchesEntirely from './matchesEntirely.js';
|
|
3
3
|
|
|
4
|
-
function _createForOfIteratorHelperLoose(
|
|
5
|
-
var
|
|
6
|
-
if (
|
|
7
|
-
if (Array.isArray(
|
|
8
|
-
|
|
9
|
-
var
|
|
4
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
5
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
6
|
+
if (it) return (it = it.call(o)).next.bind(it);
|
|
7
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) {
|
|
8
|
+
if (it) o = it;
|
|
9
|
+
var i = 0;
|
|
10
10
|
return function () {
|
|
11
|
-
|
|
11
|
+
if (i >= o.length) return {
|
|
12
12
|
done: true
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
14
15
|
done: false,
|
|
15
|
-
value:
|
|
16
|
+
value: o[i++]
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
20
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
20
21
|
}
|
|
21
|
-
function _unsupportedIterableToArray(
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
23
|
+
if (!o) return;
|
|
24
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
25
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
26
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
27
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
28
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
27
29
|
}
|
|
28
|
-
function _arrayLikeToArray(
|
|
29
|
-
(
|
|
30
|
-
for (var
|
|
31
|
-
|
|
30
|
+
function _arrayLikeToArray(arr, len) {
|
|
31
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
32
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
33
|
+
arr2[i] = arr[i];
|
|
34
|
+
}
|
|
35
|
+
return arr2;
|
|
32
36
|
}
|
|
33
|
-
var NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL'];
|
|
37
|
+
var NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL']; // Finds out national phone number type (fixed line, mobile, etc)
|
|
34
38
|
|
|
35
|
-
// Finds out national phone number type (fixed line, mobile, etc)
|
|
36
39
|
function getNumberType(input, options, metadata) {
|
|
37
40
|
// If assigning the `{}` default value is moved to the arguments above,
|
|
38
41
|
// code coverage would decrease for some weird reason.
|
|
39
|
-
options = options || {};
|
|
40
|
-
|
|
41
|
-
// When `parse()` returns an empty object — `{}` —
|
|
42
|
+
options = options || {}; // When `parse()` returns an empty object — `{}` —
|
|
42
43
|
// that means that the phone number is malformed,
|
|
43
44
|
// so it can't possibly be valid.
|
|
45
|
+
|
|
44
46
|
if (!input.country && !input.countryCallingCode) {
|
|
45
47
|
return;
|
|
46
48
|
}
|
|
47
49
|
metadata = new Metadata(metadata);
|
|
48
50
|
metadata.selectNumberingPlan(input.country, input.countryCallingCode);
|
|
49
|
-
var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
|
|
50
|
-
|
|
51
|
-
// The following is copy-pasted from the original function:
|
|
51
|
+
var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // The following is copy-pasted from the original function:
|
|
52
52
|
// https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835
|
|
53
|
-
|
|
54
53
|
// Is this national number even valid for this country
|
|
54
|
+
|
|
55
55
|
if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {
|
|
56
56
|
return;
|
|
57
|
-
}
|
|
57
|
+
} // Is it fixed line number
|
|
58
58
|
|
|
59
|
-
// Is it fixed line number
|
|
60
59
|
if (isNumberTypeEqualTo(nationalNumber, 'FIXED_LINE', metadata)) {
|
|
61
60
|
// Because duplicate regular expressions are removed
|
|
62
61
|
// to reduce metadata size, if "mobile" pattern is ""
|
|
@@ -64,22 +63,21 @@ function getNumberType(input, options, metadata) {
|
|
|
64
63
|
//
|
|
65
64
|
if (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') {
|
|
66
65
|
return 'FIXED_LINE_OR_MOBILE';
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// `MOBILE` type pattern isn't included if it matched `FIXED_LINE` one.
|
|
66
|
+
} // `MOBILE` type pattern isn't included if it matched `FIXED_LINE` one.
|
|
70
67
|
// For example, for "US" country.
|
|
71
68
|
// Old metadata (< `1.0.18`) had a specific "types" data structure
|
|
72
69
|
// that happened to be `undefined` for `MOBILE` in that case.
|
|
73
70
|
// Newer metadata (>= `1.0.18`) has another data structure that is
|
|
74
71
|
// not `undefined` for `MOBILE` in that case (it's just an empty array).
|
|
75
72
|
// So this `if` is just for backwards compatibility with old metadata.
|
|
73
|
+
|
|
76
74
|
if (!metadata.type('MOBILE')) {
|
|
77
75
|
return 'FIXED_LINE_OR_MOBILE';
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Check if the number happens to qualify as both fixed line and mobile.
|
|
76
|
+
} // Check if the number happens to qualify as both fixed line and mobile.
|
|
81
77
|
// (no such country in the minimal metadata set)
|
|
78
|
+
|
|
82
79
|
/* istanbul ignore if */
|
|
80
|
+
|
|
83
81
|
if (isNumberTypeEqualTo(nationalNumber, 'MOBILE', metadata)) {
|
|
84
82
|
return 'FIXED_LINE_OR_MOBILE';
|
|
85
83
|
}
|
|
@@ -96,13 +94,13 @@ function isNumberTypeEqualTo(nationalNumber, type, metadata) {
|
|
|
96
94
|
type = metadata.type(type);
|
|
97
95
|
if (!type || !type.pattern()) {
|
|
98
96
|
return false;
|
|
99
|
-
}
|
|
100
|
-
// Check if any possible number lengths are present;
|
|
97
|
+
} // Check if any possible number lengths are present;
|
|
101
98
|
// if so, we use them to avoid checking
|
|
102
99
|
// the validation pattern if they don't match.
|
|
103
100
|
// If they are absent, this means they match
|
|
104
101
|
// the general description, which we have
|
|
105
102
|
// already checked before a specific number type.
|
|
103
|
+
|
|
106
104
|
if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {
|
|
107
105
|
return false;
|
|
108
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNumberType.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/getNumberType.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(
|
|
1
|
+
{"version":3,"file":"getNumberType.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/getNumberType.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport Metadata from '../metadata.js';\nimport matchesEntirely from './matchesEntirely.js';\nvar NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL']; // Finds out national phone number type (fixed line, mobile, etc)\n\nexport default function getNumberType(input, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {}; // When `parse()` returns an empty object — `{}` —\n // that means that the phone number is malformed,\n // so it can't possibly be valid.\n\n if (!input.country && !input.countryCallingCode) {\n return;\n }\n\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(input.country, input.countryCallingCode);\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // The following is copy-pasted from the original function:\n // https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835\n // Is this national number even valid for this country\n\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {\n return;\n } // Is it fixed line number\n\n\n if (isNumberTypeEqualTo(nationalNumber, 'FIXED_LINE', metadata)) {\n // Because duplicate regular expressions are removed\n // to reduce metadata size, if \"mobile\" pattern is \"\"\n // then it means it was removed due to being a duplicate of the fixed-line pattern.\n //\n if (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') {\n return 'FIXED_LINE_OR_MOBILE';\n } // `MOBILE` type pattern isn't included if it matched `FIXED_LINE` one.\n // For example, for \"US\" country.\n // Old metadata (< `1.0.18`) had a specific \"types\" data structure\n // that happened to be `undefined` for `MOBILE` in that case.\n // Newer metadata (>= `1.0.18`) has another data structure that is\n // not `undefined` for `MOBILE` in that case (it's just an empty array).\n // So this `if` is just for backwards compatibility with old metadata.\n\n\n if (!metadata.type('MOBILE')) {\n return 'FIXED_LINE_OR_MOBILE';\n } // Check if the number happens to qualify as both fixed line and mobile.\n // (no such country in the minimal metadata set)\n\n /* istanbul ignore if */\n\n\n if (isNumberTypeEqualTo(nationalNumber, 'MOBILE', metadata)) {\n return 'FIXED_LINE_OR_MOBILE';\n }\n\n return 'FIXED_LINE';\n }\n\n for (var _iterator = _createForOfIteratorHelperLoose(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done;) {\n var type = _step.value;\n\n if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {\n return type;\n }\n }\n}\nexport function isNumberTypeEqualTo(nationalNumber, type, metadata) {\n type = metadata.type(type);\n\n if (!type || !type.pattern()) {\n return false;\n } // Check if any possible number lengths are present;\n // if so, we use them to avoid checking\n // the validation pattern if they don't match.\n // If they are absent, this means they match\n // the general description, which we have\n // already checked before a specific number type.\n\n\n if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {\n return false;\n }\n\n return matchesEntirely(nationalNumber, type.pattern());\n}\n//# sourceMappingURL=getNumberType.js.map"],"names":["NON_FIXED_LINE_PHONE_TYPES","getNumberType","input","options","metadata","country","countryCallingCode","Metadata","selectNumberingPlan","nationalNumber","v2","phone","matchesEntirely","nationalNumberPattern","isNumberTypeEqualTo","type","pattern","_iterator","_createForOfIteratorHelperLoose","_step","done","value","possibleLengths","indexOf","length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,0BAA0B,GAAG,CAClC,QADkC,EAElC,cAFkC,EAGlC,WAHkC,EAIlC,aAJkC,EAKlC,MALkC,EAMlC,iBANkC,EAOlC,OAPkC,EAQlC,KARkC,EASlC,WATkC,CAAnC;;AAae,SAASC,aAATA,CAAuBC,KAAvB,EAA8BC,OAA9B,EAAuCC,QAAvC,EACf;AACC;AACA;AACAD,EAAAA,OAAO,GAAGA,OAAO,IAAI,EAArB,CAHD;AAMC;AACA;;EACA,IAAI,CAACD,KAAK,CAACG,OAAP,IAAkB,CAACH,KAAK,CAACI,kBAA7B,EAAiD;AAChD,IAAA;AACA,EAAA;AAEDF,EAAAA,QAAQ,GAAG,IAAIG,QAAJ,CAAaH,QAAb,CAAX;EAEAA,QAAQ,CAACI,mBAAT,CAA6BN,KAAK,CAACG,OAAnC,EAA4CH,KAAK,CAACI,kBAAlD,CAAA;AAEA,EAAA,IAAMG,cAAc,GAAGN,OAAO,CAACO,EAAR,GAAaR,KAAK,CAACO,cAAnB,GAAoCP,KAAK,CAACS,KAAjE,CAhBD;AAmBC;AAEA;;EACA,IAAI,CAACC,eAAe,CAACH,cAAD,EAAiBL,QAAQ,CAACS,qBAAT,EAAjB,CAApB,EAAwE;AACvE,IAAA;AACA,EAAA,CAxBF;;EA2BC,IAAIC,mBAAmB,CAACL,cAAD,EAAiB,YAAjB,EAA+BL,QAA/B,CAAvB,EAAiE;AAChE;AACA;AACA;AACA;AACA,IAAA,IAAIA,QAAQ,CAACW,IAAT,CAAc,QAAd,CAAA,IAA2BX,QAAQ,CAACW,IAAT,CAAc,QAAd,CAAA,CAAwBC,OAAxB,EAAA,KAAsC,EAArE,EAAyE;AACxE,MAAA,OAAO,sBAAP;AACA,IAAA,CAP+D;AAUhE;AACA;AACA;AACA;AACA;AACA;;AACA,IAAA,IAAI,CAACZ,QAAQ,CAACW,IAAT,CAAc,QAAd,CAAL,EAA8B;AAC7B,MAAA,OAAO,sBAAP;AACA,IAAA,CAlB+D;AAqBhE;;AACA;;IACA,IAAID,mBAAmB,CAACL,cAAD,EAAiB,QAAjB,EAA2BL,QAA3B,CAAvB,EAA6D;AAC5D,MAAA,OAAO,sBAAP;AACA,IAAA;AAED,IAAA,OAAO,YAAP;AACA,EAAA;AAED,EAAA,KAAA,IAAAa,SAAA,GAAAC,+BAAA,CAAmBlB,0BAAnB,CAAA,EAAAmB,KAAA,EAAA,CAAA,CAAAA,KAAA,GAAAF,SAAA,EAAA,EAAAG,IAAA,GAA+C;AAAA,IAAA,IAApCL,IAAoC,GAAAI,KAAA,CAAAE,KAAA;IAC9C,IAAIP,mBAAmB,CAACL,cAAD,EAAiBM,IAAjB,EAAuBX,QAAvB,CAAvB,EAAyD;AACxD,MAAA,OAAOW,IAAP;AACA,IAAA;AACD,EAAA;AACD;AAEM,SAASD,mBAATA,CAA6BL,cAA7B,EAA6CM,IAA7C,EAAmDX,QAAnD,EAA6D;AACnEW,EAAAA,IAAI,GAAGX,QAAQ,CAACW,IAAT,CAAcA,IAAd,CAAP;EACA,IAAI,CAACA,IAAD,IAAS,CAACA,IAAI,CAACC,OAAL,EAAd,EAA8B;AAC7B,IAAA,OAAO,KAAP;AACA,EAAA,CAJkE;AAMnE;AACA;AACA;AACA;AACA;;AACA,EAAA,IAAID,IAAI,CAACO,eAAL,EAAA,IACHP,IAAI,CAACO,eAAL,EAAA,CAAuBC,OAAvB,CAA+Bd,cAAc,CAACe,MAA9C,CAAA,GAAwD,CADzD,EAC4D;AAC3D,IAAA,OAAO,KAAP;AACA,EAAA;EACD,OAAOZ,eAAe,CAACH,cAAD,EAAiBM,IAAI,CAACC,OAAL,EAAjB,CAAtB;AACA;;;;","x_google_ignoreList":[0]}
|
|
@@ -7,6 +7,7 @@ import Metadata from '../metadata.js';
|
|
|
7
7
|
* @param {object} metadata — Metadata.
|
|
8
8
|
* @return {string[]} A list of possible countries.
|
|
9
9
|
*/
|
|
10
|
+
|
|
10
11
|
function getPossibleCountriesForNumber(callingCode, nationalNumber, metadata) {
|
|
11
12
|
var _metadata = new Metadata(metadata);
|
|
12
13
|
var possibleCountries = _metadata.getCountryCodesForCallingCode(callingCode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPossibleCountriesForNumber.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js"],"sourcesContent":["import Metadata from '../metadata.js';\n
|
|
1
|
+
{"version":3,"file":"getPossibleCountriesForNumber.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js"],"sourcesContent":["import Metadata from '../metadata.js';\n/**\r\n * Returns a list of countries that the phone number could potentially belong to.\r\n * @param {string} callingCode — Calling code.\r\n * @param {string} nationalNumber — National (significant) number.\r\n * @param {object} metadata — Metadata.\r\n * @return {string[]} A list of possible countries.\r\n */\n\nexport default function getPossibleCountriesForNumber(callingCode, nationalNumber, metadata) {\n var _metadata = new Metadata(metadata);\n\n var possibleCountries = _metadata.getCountryCodesForCallingCode(callingCode);\n\n if (!possibleCountries) {\n return [];\n }\n\n return possibleCountries.filter(function (country) {\n return couldNationalNumberBelongToCountry(nationalNumber, country, metadata);\n });\n}\n\nfunction couldNationalNumberBelongToCountry(nationalNumber, country, metadata) {\n var _metadata = new Metadata(metadata);\n\n _metadata.selectNumberingPlan(country);\n\n if (_metadata.numberingPlan.possibleLengths().indexOf(nationalNumber.length) >= 0) {\n return true;\n }\n\n return false;\n}\n//# sourceMappingURL=getPossibleCountriesForNumber.js.map"],"names":["getPossibleCountriesForNumber","callingCode","nationalNumber","metadata","_metadata","Metadata","possibleCountries","getCountryCodesForCallingCode","filter","country","couldNationalNumberBelongToCountry","selectNumberingPlan","numberingPlan","possibleLengths","indexOf","length"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASA,6BAATA,CAAuCC,WAAvC,EAAoDC,cAApD,EAAoEC,QAApE,EAA8E;AAC5F,EAAA,IAAMC,SAAS,GAAG,IAAIC,QAAJ,CAAaF,QAAb,CAAlB;AACA,EAAA,IAAIG,iBAAiB,GAAGF,SAAS,CAACG,6BAAV,CAAwCN,WAAxC,CAAxB;EACA,IAAI,CAACK,iBAAL,EAAwB;AACvB,IAAA,OAAO,EAAP;AACA,EAAA;AACD,EAAA,OAAOA,iBAAiB,CAACE,MAAlB,CAAyB,UAACC,OAAD,EAAa;AAC5C,IAAA,OAAOC,kCAAkC,CAACR,cAAD,EAAiBO,OAAjB,EAA0BN,QAA1B,CAAzC;AACA,EAAA,CAFM,CAAP;AAGA;AAED,SAASO,kCAATA,CAA4CR,cAA5C,EAA4DO,OAA5D,EAAqEN,QAArE,EAA+E;AAC9E,EAAA,IAAMC,SAAS,GAAG,IAAIC,QAAJ,CAAaF,QAAb,CAAlB;EACAC,SAAS,CAACO,mBAAV,CAA8BF,OAA9B,CAAA;AACA,EAAA,IAAIL,SAAS,CAACQ,aAAV,CAAwBC,eAAxB,EAAA,CAA0CC,OAA1C,CAAkDZ,cAAc,CAACa,MAAjE,CAAA,IAA4E,CAAhF,EAAmF;AAClF,IAAA,OAAO,IAAP;AACA,EAAA;AACD,EAAA,OAAO,KAAP;AACA;;;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isObject.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/isObject.js"],"sourcesContent":["var objectConstructor = {}.constructor;\nexport default function isObject(object) {\n return object !== undefined && object !== null && object.constructor === objectConstructor;\n}\n//# sourceMappingURL=isObject.js.map"],"names":["objectConstructor","constructor","isObject","object","undefined"],"mappings":"AAAA,IAAMA,iBAAiB,GAAG,
|
|
1
|
+
{"version":3,"file":"isObject.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/isObject.js"],"sourcesContent":["var objectConstructor = {}.constructor;\nexport default function isObject(object) {\n return object !== undefined && object !== null && object.constructor === objectConstructor;\n}\n//# sourceMappingURL=isObject.js.map"],"names":["objectConstructor","constructor","isObject","object","undefined"],"mappings":"AAAA,IAAMA,iBAAiB,GAAG,EAAA,CAAGC,WAA7B;AAEe,SAASC,QAATA,CAAkBC,MAAlB,EAA0B;AACvC,EAAA,OAAOA,MAAM,KAAKC,SAAX,IAAwBD,MAAM,KAAK,IAAnC,IAA2CA,MAAM,CAACF,WAAP,KAAuBD,iBAAzE;AACD;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { MIN_LENGTH_FOR_NSN, VALID_DIGITS, PLUS_CHARS, VALID_PUNCTUATION } from '../constants.js';
|
|
2
2
|
import createExtensionPattern from './extension/createExtensionPattern.js';
|
|
3
3
|
|
|
4
|
-
// Regular expression of viable phone numbers. This is location independent.
|
|
5
4
|
// Checks we have at least three leading digits, and only valid punctuation,
|
|
6
5
|
// alpha characters and digits in the phone number. Does not include extension
|
|
7
6
|
// data. The symbol 'x' is allowed here as valid punctuation since it is often
|
|
@@ -25,14 +24,13 @@ import createExtensionPattern from './extension/createExtensionPattern.js';
|
|
|
25
24
|
// so must be the first in the range" (c) Google devs.
|
|
26
25
|
// (wtf did they mean by saying that; probably nothing)
|
|
27
26
|
//
|
|
28
|
-
|
|
29
|
-
//
|
|
27
|
+
|
|
28
|
+
var MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}'; //
|
|
30
29
|
// And this is the second reg-exp:
|
|
31
30
|
// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)
|
|
32
31
|
//
|
|
33
|
-
var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';
|
|
34
32
|
|
|
35
|
-
// This regular expression isn't present in Google's `libphonenumber`
|
|
33
|
+
var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*'; // This regular expression isn't present in Google's `libphonenumber`
|
|
36
34
|
// and is only used to determine whether the phone number being input
|
|
37
35
|
// is too short for it to even consider it a "valid" number.
|
|
38
36
|
// This is just a way to differentiate between a really invalid phone
|
|
@@ -41,36 +39,34 @@ var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCT
|
|
|
41
39
|
// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this
|
|
42
40
|
// library can provide a more detailed error message — whether it's
|
|
43
41
|
// really "not a number", or is it just a start of a valid phone number.
|
|
42
|
+
|
|
44
43
|
var VALID_PHONE_NUMBER_START_REG_EXP = new RegExp('^' + '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){1,2}' + '$', 'i');
|
|
45
44
|
var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER +
|
|
46
45
|
// Phone number extensions
|
|
47
|
-
'(?:' + createExtensionPattern() + ')?';
|
|
48
|
-
|
|
49
|
-
// The combined regular expression for valid phone numbers:
|
|
46
|
+
'(?:' + createExtensionPattern() + ')?'; // The combined regular expression for valid phone numbers:
|
|
50
47
|
//
|
|
48
|
+
|
|
51
49
|
var VALID_PHONE_NUMBER_PATTERN = new RegExp(
|
|
52
50
|
// Either a short two-digit-only phone number
|
|
53
51
|
'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' +
|
|
54
52
|
// Or a longer fully parsed phone number (min 3 characters)
|
|
55
|
-
'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i');
|
|
56
|
-
|
|
57
|
-
// Checks to see if the string of characters could possibly be a phone number at
|
|
53
|
+
'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i'); // Checks to see if the string of characters could possibly be a phone number at
|
|
58
54
|
// all. At the moment, checks to see that the string begins with at least 2
|
|
59
55
|
// digits, ignoring any punctuation commonly found in phone numbers. This method
|
|
60
56
|
// does not require the number to be normalized in advance - but does assume
|
|
61
57
|
// that leading non-number symbols have been removed, such as by the method
|
|
62
58
|
// `extract_possible_number`.
|
|
63
59
|
//
|
|
60
|
+
|
|
64
61
|
function isViablePhoneNumber(number) {
|
|
65
62
|
return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// This is just a way to differentiate between a really invalid phone
|
|
63
|
+
} // This is just a way to differentiate between a really invalid phone
|
|
69
64
|
// number like "abcde" and a valid phone number that a user has just
|
|
70
65
|
// started inputting, like "+1" or "1": both these cases would be
|
|
71
66
|
// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this
|
|
72
67
|
// library can provide a more detailed error message — whether it's
|
|
73
68
|
// really "not a number", or is it just a start of a valid phone number.
|
|
69
|
+
|
|
74
70
|
function isViablePhoneNumberStart(number) {
|
|
75
71
|
return VALID_PHONE_NUMBER_START_REG_EXP.test(number);
|
|
76
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isViablePhoneNumber.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js"],"sourcesContent":["import { MIN_LENGTH_FOR_NSN, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from '../constants.js';\nimport createExtensionPattern from './extension/createExtensionPattern.js'
|
|
1
|
+
{"version":3,"file":"isViablePhoneNumber.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js"],"sourcesContent":["import { MIN_LENGTH_FOR_NSN, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from '../constants.js';\nimport createExtensionPattern from './extension/createExtensionPattern.js'; // Regular expression of viable phone numbers. This is location independent.\n// Checks we have at least three leading digits, and only valid punctuation,\n// alpha characters and digits in the phone number. Does not include extension\n// data. The symbol 'x' is allowed here as valid punctuation since it is often\n// used as a placeholder for carrier codes, for example in Brazilian phone\n// numbers. We also allow multiple '+' characters at the start.\n//\n// Corresponds to the following:\n// [digits]{minLengthNsn}|\n// plus_sign*\n// (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*\n//\n// The first reg-ex is to allow short numbers (two digits long) to be parsed if\n// they are entered as \"15\" etc, but only if there is no punctuation in them.\n// The second expression restricts the number of digits to three or more, but\n// then allows them to be in international form, and to have alpha-characters\n// and punctuation. We split up the two reg-exes here and combine them when\n// creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it\n// with ^ and append $ to each branch.\n//\n// \"Note VALID_PUNCTUATION starts with a -,\n// so must be the first in the range\" (c) Google devs.\n// (wtf did they mean by saying that; probably nothing)\n//\n\nvar MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}'; //\n// And this is the second reg-exp:\n// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)\n//\n\nexport var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*'; // This regular expression isn't present in Google's `libphonenumber`\n// and is only used to determine whether the phone number being input\n// is too short for it to even consider it a \"valid\" number.\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\n\nvar VALID_PHONE_NUMBER_START_REG_EXP = new RegExp('^' + '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){1,2}' + '$', 'i');\nexport var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions\n'(?:' + createExtensionPattern() + ')?'; // The combined regular expression for valid phone numbers:\n//\n\nvar VALID_PHONE_NUMBER_PATTERN = new RegExp( // Either a short two-digit-only phone number\n'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' + // Or a longer fully parsed phone number (min 3 characters)\n'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i'); // Checks to see if the string of characters could possibly be a phone number at\n// all. At the moment, checks to see that the string begins with at least 2\n// digits, ignoring any punctuation commonly found in phone numbers. This method\n// does not require the number to be normalized in advance - but does assume\n// that leading non-number symbols have been removed, such as by the method\n// `extract_possible_number`.\n//\n\nexport default function isViablePhoneNumber(number) {\n return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);\n} // This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\n\nexport function isViablePhoneNumberStart(number) {\n return VALID_PHONE_NUMBER_START_REG_EXP.test(number);\n}\n//# sourceMappingURL=isViablePhoneNumber.js.map"],"names":["MIN_LENGTH_PHONE_NUMBER_PATTERN","VALID_DIGITS","MIN_LENGTH_FOR_NSN","VALID_PHONE_NUMBER","PLUS_CHARS","VALID_PUNCTUATION","VALID_PHONE_NUMBER_START_REG_EXP","RegExp","VALID_PHONE_NUMBER_WITH_EXTENSION","createExtensionPattern","VALID_PHONE_NUMBER_PATTERN","isViablePhoneNumber","number","length","test","isViablePhoneNumberStart"],"mappings":";;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMA,+BAA+B,GAAG,GAAA,GAAMC,YAAN,GAAqB,IAArB,GAA4BC,kBAA5B,GAAiD,GAAzF;AAEA;AACA;AACA;;AACO,IAAMC,kBAAkB,GAC9B,GAAA,GAAMC,UAAN,GAAmB,QAAnB,GACA,KADA,GAEC,GAFD,GAEOC,iBAFP,GAE2B,IAF3B,GAGC,GAHD,GAGOJ,YAHP,GAGsB,GAHtB,GAIA,OAJA,GAKA,GALA,GAMCI,iBAND,GAOCJ,YAPD,GAQA;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMK,gCAAgC,GAAG,IAAIC,MAAJ,CACxC,GAAA,GACA,GADA,GACMH,UADN,GACmB,QADnB,GAEA,KAFA,GAGC,GAHD,GAGOC,iBAHP,GAG2B,IAH3B,GAIC,GAJD,GAIOJ,YAJP,GAIsB,GAJtB,GAKA,QALA,GAMA,GAPwC,EAQvC,GARuC,CAAzC;AAUO,IAAMO,iCAAiC,GAC7CL,kBAAkB;AAClB;AACA,KAFA,GAEQM,sBAAsB,EAF9B,GAEmC;AAGpC;;AACA,IAAMC,0BAA0B,GAAG,IAAIH,MAAJ;AAClC;AACA,GAAA,GACCP,+BADD,GAEA,GAFA,GAGA,GAHA;AAIA;AACA,GALA,GAMCQ,iCAND,GAOA,GATkC,EAUjC,GAViC,CAAnC;AAaA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASG,mBAATA,CAA6BC,MAA7B,EAAqC;EACnD,OAAOA,MAAM,CAACC,MAAP,IAAiBX,kBAAjB,IACNQ,0BAA0B,CAACI,IAA3B,CAAgCF,MAAhC,CADD;AAEA;AAGD;AACA;AACA;AACA;AACA;;AACO,SAASG,wBAATA,CAAkCH,MAAlC,EAA0C;AAChD,EAAA,OAAON,gCAAgC,CAACQ,IAAjC,CAAsCF,MAAtC,CAAP;AACA;;;;","x_google_ignoreList":[0]}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* against the regular expression.
|
|
4
4
|
* @return {boolean}
|
|
5
5
|
*/
|
|
6
|
-
function matchesEntirely(text,
|
|
7
|
-
// If
|
|
8
|
-
//
|
|
6
|
+
function matchesEntirely(text, regular_expression) {
|
|
7
|
+
// If assigning the `''` default value is moved to the arguments above,
|
|
8
|
+
// code coverage would decrease for some weird reason.
|
|
9
9
|
text = text || '';
|
|
10
|
-
return new RegExp('^(?:' +
|
|
10
|
+
return new RegExp('^(?:' + regular_expression + ')$').test(text);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export { matchesEntirely as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchesEntirely.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js"],"sourcesContent":["/**\r\n * Checks whether the entire input sequence can be matched\r\n * against the regular expression.\r\n * @return {boolean}\r\n */\nexport default function matchesEntirely(text,
|
|
1
|
+
{"version":3,"file":"matchesEntirely.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js"],"sourcesContent":["/**\r\n * Checks whether the entire input sequence can be matched\r\n * against the regular expression.\r\n * @return {boolean}\r\n */\nexport default function matchesEntirely(text, regular_expression) {\n // If assigning the `''` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n text = text || '';\n return new RegExp('^(?:' + regular_expression + ')$').test(text);\n}\n//# sourceMappingURL=matchesEntirely.js.map"],"names":["matchesEntirely","text","regular_expression","RegExp","test"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACe,SAASA,eAATA,CAAyBC,IAAzB,EAA+BC,kBAA/B,EAAmD;AACjE;AACA;EACAD,IAAI,GAAGA,IAAI,IAAI,EAAf;EACA,OAAO,IAAIE,MAAJ,CAAW,MAAA,GAASD,kBAAT,GAA8B,IAAzC,CAAA,CAA+CE,IAA/C,CAAoDH,IAApD,CAAP;AACA;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
function _createForOfIteratorHelperLoose(
|
|
2
|
-
var
|
|
3
|
-
if (
|
|
4
|
-
if (Array.isArray(
|
|
5
|
-
|
|
6
|
-
var
|
|
1
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
2
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
3
|
+
if (it) return (it = it.call(o)).next.bind(it);
|
|
4
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) {
|
|
5
|
+
if (it) o = it;
|
|
6
|
+
var i = 0;
|
|
7
7
|
return function () {
|
|
8
|
-
|
|
8
|
+
if (i >= o.length) return {
|
|
9
9
|
done: true
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
11
12
|
done: false,
|
|
12
|
-
value:
|
|
13
|
+
value: o[i++]
|
|
13
14
|
};
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
17
18
|
}
|
|
18
|
-
function _unsupportedIterableToArray(
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
20
|
+
if (!o) return;
|
|
21
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
22
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
23
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
24
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
25
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
24
26
|
}
|
|
25
|
-
function _arrayLikeToArray(
|
|
26
|
-
(
|
|
27
|
-
for (var
|
|
28
|
-
|
|
27
|
+
function _arrayLikeToArray(arr, len) {
|
|
28
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
29
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
30
|
+
arr2[i] = arr[i];
|
|
31
|
+
}
|
|
32
|
+
return arr2;
|
|
29
33
|
}
|
|
34
|
+
|
|
30
35
|
// These mappings map a character (key) to a specific digit that should
|
|
31
36
|
// replace it for normalization purposes. Non-European digits that
|
|
32
37
|
// may be used in phone numbers are mapped to a European equivalent.
|
|
@@ -107,7 +112,6 @@ var DIGITS = {
|
|
|
107
112
|
function parseDigit(character) {
|
|
108
113
|
return DIGITS[character];
|
|
109
114
|
}
|
|
110
|
-
|
|
111
115
|
/**
|
|
112
116
|
* Parses phone number digits from a string.
|
|
113
117
|
* Drops all punctuation leaving only digits.
|
|
@@ -121,14 +125,15 @@ function parseDigit(character) {
|
|
|
121
125
|
* // Outputs '8800555'.
|
|
122
126
|
* ```
|
|
123
127
|
*/
|
|
128
|
+
|
|
124
129
|
function parseDigits(string) {
|
|
125
|
-
var result = '';
|
|
126
|
-
// Using `.split('')` here instead of normal `for ... of`
|
|
130
|
+
var result = ''; // Using `.split('')` here instead of normal `for ... of`
|
|
127
131
|
// because the importing application doesn't neccessarily include an ES6 polyfill.
|
|
128
132
|
// The `.split('')` approach discards "exotic" UTF-8 characters
|
|
129
133
|
// (the ones consisting of four bytes) but digits
|
|
130
134
|
// (including non-European ones) don't fall into that range
|
|
131
135
|
// so such "exotic" characters would be discarded anyway.
|
|
136
|
+
|
|
132
137
|
for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {
|
|
133
138
|
var character = _step.value;
|
|
134
139
|
var digit = parseDigit(character);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseDigits.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/parseDigits.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(
|
|
1
|
+
{"version":3,"file":"parseDigits.js","sources":["../../../../../node_modules/libphonenumber-js/es6/helpers/parseDigits.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n// These mappings map a character (key) to a specific digit that should\n// replace it for normalization purposes. Non-European digits that\n// may be used in phone numbers are mapped to a European equivalent.\n//\n// E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\n//\nexport var DIGITS = {\n '0': '0',\n '1': '1',\n '2': '2',\n '3': '3',\n '4': '4',\n '5': '5',\n '6': '6',\n '7': '7',\n '8': '8',\n '9': '9',\n \"\\uFF10\": '0',\n // Fullwidth digit 0\n \"\\uFF11\": '1',\n // Fullwidth digit 1\n \"\\uFF12\": '2',\n // Fullwidth digit 2\n \"\\uFF13\": '3',\n // Fullwidth digit 3\n \"\\uFF14\": '4',\n // Fullwidth digit 4\n \"\\uFF15\": '5',\n // Fullwidth digit 5\n \"\\uFF16\": '6',\n // Fullwidth digit 6\n \"\\uFF17\": '7',\n // Fullwidth digit 7\n \"\\uFF18\": '8',\n // Fullwidth digit 8\n \"\\uFF19\": '9',\n // Fullwidth digit 9\n \"\\u0660\": '0',\n // Arabic-indic digit 0\n \"\\u0661\": '1',\n // Arabic-indic digit 1\n \"\\u0662\": '2',\n // Arabic-indic digit 2\n \"\\u0663\": '3',\n // Arabic-indic digit 3\n \"\\u0664\": '4',\n // Arabic-indic digit 4\n \"\\u0665\": '5',\n // Arabic-indic digit 5\n \"\\u0666\": '6',\n // Arabic-indic digit 6\n \"\\u0667\": '7',\n // Arabic-indic digit 7\n \"\\u0668\": '8',\n // Arabic-indic digit 8\n \"\\u0669\": '9',\n // Arabic-indic digit 9\n \"\\u06F0\": '0',\n // Eastern-Arabic digit 0\n \"\\u06F1\": '1',\n // Eastern-Arabic digit 1\n \"\\u06F2\": '2',\n // Eastern-Arabic digit 2\n \"\\u06F3\": '3',\n // Eastern-Arabic digit 3\n \"\\u06F4\": '4',\n // Eastern-Arabic digit 4\n \"\\u06F5\": '5',\n // Eastern-Arabic digit 5\n \"\\u06F6\": '6',\n // Eastern-Arabic digit 6\n \"\\u06F7\": '7',\n // Eastern-Arabic digit 7\n \"\\u06F8\": '8',\n // Eastern-Arabic digit 8\n \"\\u06F9\": '9' // Eastern-Arabic digit 9\n\n};\nexport function parseDigit(character) {\n return DIGITS[character];\n}\n/**\r\n * Parses phone number digits from a string.\r\n * Drops all punctuation leaving only digits.\r\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n * @param {string} string\r\n * @return {string}\r\n * @example\r\n * ```js\r\n * parseDigits('8 (800) 555')\r\n * // Outputs '8800555'.\r\n * ```\r\n */\n\nexport default function parseDigits(string) {\n var result = ''; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n var digit = parseDigit(character);\n\n if (digit) {\n result += digit;\n }\n }\n\n return result;\n}\n//# sourceMappingURL=parseDigits.js.map"],"names":["DIGITS","parseDigit","character","parseDigits","string","result","_iterator","_createForOfIteratorHelperLoose","split","_step","done","value","digit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,MAAM,GAAG;AACrB,EAAA,GAAA,EAAK,GADgB;AAErB,EAAA,GAAA,EAAK,GAFgB;AAGrB,EAAA,GAAA,EAAK,GAHgB;AAIrB,EAAA,GAAA,EAAK,GAJgB;AAKrB,EAAA,GAAA,EAAK,GALgB;AAMrB,EAAA,GAAA,EAAK,GANgB;AAOrB,EAAA,GAAA,EAAK,GAPgB;AAQrB,EAAA,GAAA,EAAK,GARgB;AASrB,EAAA,GAAA,EAAK,GATgB;AAUrB,EAAA,GAAA,EAAK,GAVgB;AAWrB,EAAA,QAAA,EAAU,GAXW;AAWN;AACf,EAAA,QAAA,EAAU,GAZW;AAYN;AACf,EAAA,QAAA,EAAU,GAbW;AAaN;AACf,EAAA,QAAA,EAAU,GAdW;AAcN;AACf,EAAA,QAAA,EAAU,GAfW;AAeN;AACf,EAAA,QAAA,EAAU,GAhBW;AAgBN;AACf,EAAA,QAAA,EAAU,GAjBW;AAiBN;AACf,EAAA,QAAA,EAAU,GAlBW;AAkBN;AACf,EAAA,QAAA,EAAU,GAnBW;AAmBN;AACf,EAAA,QAAA,EAAU,GApBW;AAoBN;AACf,EAAA,QAAA,EAAU,GArBW;AAqBN;AACf,EAAA,QAAA,EAAU,GAtBW;AAsBN;AACf,EAAA,QAAA,EAAU,GAvBW;AAuBN;AACf,EAAA,QAAA,EAAU,GAxBW;AAwBN;AACf,EAAA,QAAA,EAAU,GAzBW;AAyBN;AACf,EAAA,QAAA,EAAU,GA1BW;AA0BN;AACf,EAAA,QAAA,EAAU,GA3BW;AA2BN;AACf,EAAA,QAAA,EAAU,GA5BW;AA4BN;AACf,EAAA,QAAA,EAAU,GA7BW;AA6BN;AACf,EAAA,QAAA,EAAU,GA9BW;AA8BN;AACf,EAAA,QAAA,EAAU,GA/BW;AA+BN;AACf,EAAA,QAAA,EAAU,GAhCW;AAgCN;AACf,EAAA,QAAA,EAAU,GAjCW;AAiCN;AACf,EAAA,QAAA,EAAU,GAlCW;AAkCN;AACf,EAAA,QAAA,EAAU,GAnCW;AAmCN;AACf,EAAA,QAAA,EAAU,GApCW;AAoCN;AACf,EAAA,QAAA,EAAU,GArCW;AAqCN;AACf,EAAA,QAAA,EAAU,GAtCW;AAsCN;AACf,EAAA,QAAA,EAAU,GAvCW;AAuCN;AACf,EAAA,QAAA,EAAU,GAxCW;AAAA;AA2Cf,SAASC,UAATA,CAAoBC,SAApB,EAA+B;EACrC,OAAOF,MAAM,CAACE,SAAD,CAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASC,WAATA,CAAqBC,MAArB,EAA6B;AAC3C,EAAA,IAAIC,MAAM,GAAG,EAAb,CAD2C;AAG3C;AACA;AACA;AACA;AACA;;AACA,EAAA,KAAA,IAAAC,SAAA,GAAAC,+BAAA,CAAwBH,MAAM,CAACI,KAAP,CAAa,EAAb,CAAxB,CAAA,EAAAC,KAAA,EAAA,CAAA,CAAAA,KAAA,GAAAH,SAAA,EAAA,EAAAI,IAAA,GAA0C;AAAA,IAAA,IAA/BR,SAA+B,GAAAO,KAAA,CAAAE,KAAA;AACzC,IAAA,IAAMC,KAAK,GAAGX,UAAU,CAACC,SAAD,CAAxB;AACA,IAAA,IAAIU,KAAJ,EAAW;AACVP,MAAAA,MAAM,IAAIO,KAAV;AACA,IAAA;AACD,EAAA;AACD,EAAA,OAAOP,MAAP;AACA;;;;","x_google_ignoreList":[0]}
|
|
@@ -5,20 +5,20 @@ var CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');
|
|
|
5
5
|
function stripIddPrefix(number, country, callingCode, metadata) {
|
|
6
6
|
if (!country) {
|
|
7
7
|
return;
|
|
8
|
-
}
|
|
9
|
-
|
|
8
|
+
} // Check if the number is IDD-prefixed.
|
|
9
|
+
|
|
10
10
|
var countryMetadata = new Metadata(metadata);
|
|
11
11
|
countryMetadata.selectNumberingPlan(country, callingCode);
|
|
12
12
|
var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());
|
|
13
13
|
if (number.search(IDDPrefixPattern) !== 0) {
|
|
14
14
|
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
number = number.slice(number.match(IDDPrefixPattern)[0].length);
|
|
18
|
-
// If there're any digits after an IDD prefix,
|
|
15
|
+
} // Strip IDD prefix.
|
|
16
|
+
|
|
17
|
+
number = number.slice(number.match(IDDPrefixPattern)[0].length); // If there're any digits after an IDD prefix,
|
|
19
18
|
// then those digits are a country calling code.
|
|
20
19
|
// Since no country code starts with a `0`,
|
|
21
20
|
// the code below validates that the next digit (if present) is not `0`.
|
|
21
|
+
|
|
22
22
|
var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);
|
|
23
23
|
if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {
|
|
24
24
|
if (matchedGroups[1] === '0') {
|