lite-phone-input 0.4.0 → 0.5.0

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.
@@ -2842,7 +2842,27 @@ var phone_countries_default = [
2842
2842
  // src/core/format.ts
2843
2843
  var TRAILING_SEP = /[\s\-]+$/;
2844
2844
  var FALLBACK_GROUP = /(.{4})(?=.)/g;
2845
- var NON_ASCII_DIGITS = /[\u0660-\u0669\u06F0-\u06F9]/g;
2845
+ var NUMERAL_BASES = [
2846
+ 1632,
2847
+ // Arabic-Indic ٠-٩
2848
+ 1776,
2849
+ // Persian ۰-۹
2850
+ 2406,
2851
+ // Devanagari ०-९
2852
+ 2534,
2853
+ // Bengali ০-৯
2854
+ 3664,
2855
+ // Thai ๐-๙
2856
+ 3792,
2857
+ // Lao ໐-໙
2858
+ 4160,
2859
+ // Myanmar ၀-၉
2860
+ 6112,
2861
+ // Khmer ០-៩
2862
+ 65296
2863
+ // Fullwidth 0-9
2864
+ ];
2865
+ var NON_ASCII_DIGITS = /[\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF\u0E50-\u0E59\u0ED0-\u0ED9\u1040-\u1049\u17E0-\u17E9\uFF10-\uFF19]/g;
2846
2866
  function isRelevantChar(ch) {
2847
2867
  const c = ch.charCodeAt(0);
2848
2868
  return c >= 48 && c <= 57 || c === 43;
@@ -2892,7 +2912,12 @@ function extractDigits(value) {
2892
2912
  function normalizeNumerals(value) {
2893
2913
  return value.replace(NON_ASCII_DIGITS, (c) => {
2894
2914
  const code = c.charCodeAt(0);
2895
- return code <= 1641 ? String(code - 1632) : String(code - 1776);
2915
+ for (const base of NUMERAL_BASES) {
2916
+ if (code >= base && code <= base + 9) {
2917
+ return String(code - base);
2918
+ }
2919
+ }
2920
+ return c;
2896
2921
  });
2897
2922
  }
2898
2923