react-native-international-phone-number 0.8.3 → 0.8.5

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.
@@ -783,7 +783,7 @@ export const countries = [
783
783
  zh: '貝寧',
784
784
  tr: 'Benin',
785
785
  },
786
- phoneMasks: ['## ## ####'],
786
+ phoneMasks: ['# ## ## ## ##'],
787
787
  },
788
788
  {
789
789
  callingCode: '+590',
@@ -2282,17 +2282,52 @@ export const countries = [
2282
2282
  tr: 'Birleşik Krallık',
2283
2283
  },
2284
2284
  phoneMasks: [
2285
+ '999',
2286
+ '112',
2287
+ '100',
2288
+ '101',
2289
+ '105',
2290
+ '111',
2291
+ '119',
2292
+ '123',
2293
+ '141',
2294
+ '155',
2295
+ '159',
2296
+ '1470',
2297
+ '1471',
2298
+ '1472',
2299
+ '1474',
2300
+ '1475',
2301
+ '1476',
2302
+ '1477',
2303
+ '1478',
2304
+ '1479',
2305
+ '1571',
2306
+ '1572',
2307
+ '17070',
2308
+ '116 ###',
2309
+ '118 ###',
2310
+ '800 ## ##',
2311
+ '845 ## ##',
2285
2312
  '160## ####',
2286
2313
  '169## ####',
2287
2314
  '160## #####',
2288
2315
  '169## #####',
2316
+ '1## ## ####',
2317
+ '800 ### ###',
2289
2318
  '2# #### ####',
2319
+ '55 #### ####',
2320
+ '56 #### ####',
2321
+ '7# #### ####',
2290
2322
  '11# ### ####',
2291
2323
  '12# ### ####',
2292
2324
  '13# ### ####',
2293
2325
  '141 ### ####',
2294
2326
  '151 ### ####',
2295
2327
  '161 ### ####',
2328
+ '3## ### ####',
2329
+ '8## ### ####',
2330
+ '9## ### ####',
2296
2331
  '12## ## ####',
2297
2332
  '13## ## ####',
2298
2333
  '1642 ## ####',
@@ -3632,7 +3667,7 @@ export const countries = [
3632
3667
  zh: '韓國',
3633
3668
  tr: 'Kore Cumhuriyeti',
3634
3669
  },
3635
- phoneMasks: ['### #### ####'],
3670
+ phoneMasks: ['## ### ####', '## #### ####'],
3636
3671
  },
3637
3672
  {
3638
3673
  callingCode: '+965',
@@ -42,6 +42,9 @@ export default function getCountryByPhoneNumber(phoneNumber) {
42
42
  } else {
43
43
  matchingCountry = {
44
44
  ...matchingCountries[i],
45
+ callingCode:
46
+ matchingCountries[i].callingCode +
47
+ item.replace(/\D/g, ''),
45
48
  phoneMasks: [item.replace(/[0-9]/g, '').trim()],
46
49
  };
47
50
  }
@@ -50,14 +53,5 @@ export default function getCountryByPhoneNumber(phoneNumber) {
50
53
  }
51
54
  }
52
55
 
53
- if (matchingCountry) {
54
- matchingCountry = {
55
- name: matchingCountry.name,
56
- cca2: matchingCountry.cca2,
57
- flag: matchingCountry.flag,
58
- callingCode: matchingCountry.callingCode,
59
- };
60
- }
61
-
62
56
  return matchingCountry;
63
57
  }
@@ -1,7 +1,7 @@
1
1
  import { countries } from '../constants/countries';
2
2
 
3
3
  function startsWithZero(phoneNumber, callingCode) {
4
- const newCode = callingCode.replace('+', '');
4
+ const newCode = callingCode?.replace('+', '');
5
5
  return (
6
6
  phoneNumber.startsWith('0') ||
7
7
  phoneNumber.startsWith(`${newCode}0`)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-international-phone-number",
3
3
  "author": "AstrOOnauta (https://github.com/AstrOOnauta)",
4
- "version": "0.8.3",
4
+ "version": "0.8.5",
5
5
  "description": "International mobile phone input component with mask for React Native",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",