react-native-international-phone-number 0.4.6 → 0.4.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/README.md CHANGED
@@ -29,6 +29,10 @@
29
29
 
30
30
  <br>
31
31
 
32
+ ## Try it out
33
+
34
+ - [Demo](https://snack.expo.dev/@astroonauta/react-native-international-phone-number)
35
+
32
36
  ## List of Contents
33
37
 
34
38
  - [Installation](#installation)
@@ -505,6 +509,7 @@ export default function App() {
505
509
 
506
510
  ## Functions
507
511
 
512
+ - `getAllCountries:` () => ICountry[];
508
513
  - `getCountryByPhoneNumber:` (phoneNumber: string) => ICountry | undefined;
509
514
  - `getCountryByCca2:` (phoneNumber: string) => ICountry | undefined;
510
515
  - `getCountriesByCallingCode:` (phoneNumber: string) => ICountry[] | undefined;
package/lib/index.d.ts CHANGED
@@ -29,6 +29,8 @@ interface PhoneInputProps extends TextInputProps {
29
29
 
30
30
  declare function PhoneInput(props: PhoneInputProps): JSX.Element;
31
31
 
32
+ declare function getAllCountries(): ICountry[];
33
+
32
34
  declare function getCountryByPhoneNumber(
33
35
  phoneNumber: string
34
36
  ): ICountry | undefined;
@@ -48,6 +50,7 @@ declare function getCountriesByName(
48
50
  export {
49
51
  PhoneInput,
50
52
  ICountry,
53
+ getAllCountries,
51
54
  getCountryByPhoneNumber,
52
55
  getCountryByCca2,
53
56
  getCountriesByCallingCode,
package/lib/index.js CHANGED
@@ -10,6 +10,7 @@ import CountryPicker, {
10
10
  DEFAULT_THEME,
11
11
  } from 'react-native-country-picker-modal';
12
12
 
13
+ import getAllCountries from './utils/getAllCountries';
13
14
  import getCountriesByName from './utils/getCountriesByName';
14
15
  import getCountriesByCallingCode from './utils/getCountriesByCallingCode';
15
16
  import getCountryByCca2 from './utils/getCountryByCca2';
@@ -252,6 +253,7 @@ const styles = StyleSheet.create({
252
253
 
253
254
  export {
254
255
  PhoneInput,
256
+ getAllCountries,
255
257
  getCountryByPhoneNumber,
256
258
  getCountryByCca2,
257
259
  getCountriesByCallingCode,
@@ -0,0 +1,16 @@
1
+ import {countries} from './countries';
2
+
3
+ export default function getAllCountries() {
4
+ const formatedCountries = [];
5
+
6
+ countries.forEach(country => {
7
+ formatedCountries.push({
8
+ name: country.name,
9
+ cca2: country.cca2,
10
+ flag: country.flag,
11
+ callingCode: country.callingCode,
12
+ });
13
+ });
14
+
15
+ return formatedCountries;
16
+ }
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.6",
4
+ "version": "0.4.8",
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",