react-native-international-phone-number 0.4.1 → 0.4.3

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 CHANGED
@@ -45,6 +45,7 @@
45
45
  - Disabled Mode
46
46
  - Custom Disabled Mode Style
47
47
  - [Lib Props](#props)
48
+ - [Functions](#functions)
48
49
  - [Contributing](#contributing)
49
50
  - [License](#license)
50
51
 
@@ -452,6 +453,8 @@ export default function App() {
452
453
  - `flagContainerStyle?:` StyleProp<[ViewStyle](https://reactnative.dev/docs/view-style-props)>;
453
454
  - `inputStyle?:` StyleProp<[TextStyle](https://reactnative.dev/docs/text-style-props)>;
454
455
 
456
+ <br>
457
+
455
458
  ## Functions
456
459
 
457
460
  - `getCountryByPhoneNumber:` (phoneNumber: string) => ICountry | undefined;
@@ -3,6 +3,7 @@ import { countries } from './countries';
3
3
  export default function getCountryByPhoneNumber(phoneNumber) {
4
4
  const matchingCountries = [];
5
5
  const formattedPhoneNumber = phoneNumber.replace(/\s/g, '');
6
+
6
7
  countries.forEach((item) => {
7
8
  if (
8
9
  formattedPhoneNumber.startsWith(
@@ -48,7 +49,12 @@ export default function getCountryByPhoneNumber(phoneNumber) {
48
49
  }
49
50
  }
50
51
 
51
- delete matchingCountry['phoneMasks'];
52
+ matchingCountry = {
53
+ name: matchingCountry.name,
54
+ cca2: matchingCountry.cca2,
55
+ flag: matchingCountry.flag,
56
+ callingCode: matchingCountry.callingCode,
57
+ };
52
58
 
53
59
  return matchingCountry;
54
60
  }
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.4.1",
4
+ "version": "0.4.3",
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",