world-country-utils 0.0.1
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 +131 -0
- package/dist/data/country.d.ts +16 -0
- package/dist/data/country.js +199 -0
- package/dist/index.d.ts +165 -0
- package/dist/index.js +218 -0
- package/package.json +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# world-country-utils
|
|
2
|
+
|
|
3
|
+
A lightweight, TypeScript-first utility library for fetching country-specific data like currency codes, symbols, languages, calling codes, and more using ISO codes.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install world-country-utils
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Importing
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { countryUtils, getCountryByISO, formatAmountByISO } from 'world-country-utils';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Functions
|
|
20
|
+
|
|
21
|
+
All functions require a mandatory ISO country code (case-insensitive). If the ISO code is not found in our database, an error will be thrown.
|
|
22
|
+
|
|
23
|
+
#### 1. Get Country Name
|
|
24
|
+
```typescript
|
|
25
|
+
getCountryByISO('IN'); // "India"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
#### 2. Get Currency Code
|
|
29
|
+
```typescript
|
|
30
|
+
getCurrencyByISO('US'); // "USD"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### 3. Get Currency Symbol
|
|
34
|
+
```typescript
|
|
35
|
+
getCurrencySymbolByISO('GB'); // "£"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### 4. Format Amount
|
|
39
|
+
Formats a numeric amount with the country's currency symbol and standard grouping.
|
|
40
|
+
```typescript
|
|
41
|
+
formatAmountByISO(1234.56, 'IN'); // "₹1,234.56"
|
|
42
|
+
formatAmountByISO(500, 'US'); // "$500.00"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### 5. Get Language
|
|
46
|
+
```typescript
|
|
47
|
+
getLanguageByISO('FR'); // "French"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
#### 6. Get Area Code (Calling Code)
|
|
51
|
+
```typescript
|
|
52
|
+
getAreaCodeByISO('AE'); // "+971"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### 7. Get Phone Number Placeholder
|
|
56
|
+
```typescript
|
|
57
|
+
getPlaceholderByISO('US'); // "e.g. +1 1234567890"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### 8. Get Pincode/Postal Code Regex
|
|
61
|
+
```typescript
|
|
62
|
+
getPincodeRegexByISO('IN'); // /^[1-9][0-9]{5}$/
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### 9. Get Map Center Coordinates
|
|
66
|
+
```typescript
|
|
67
|
+
getCenterByISO('IN'); // { lat: 20.593684, lng: 78.96288 }
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### 10. Get Timezone
|
|
71
|
+
```typescript
|
|
72
|
+
getTimezoneByISO('IN'); // "Asia/Kolkata"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### 11. Get UTC Offset
|
|
76
|
+
```typescript
|
|
77
|
+
getUTCOffsetByISO('IN'); // 5.5
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### 12. Get All ISO Codes
|
|
81
|
+
```typescript
|
|
82
|
+
getAllISOCodes(); // ["AF", "AL", "DZ", ...]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### 11. Find ISO by Country Name
|
|
86
|
+
```typescript
|
|
87
|
+
getISOByName('India'); // "IN"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### 12. Validate ISO
|
|
91
|
+
```typescript
|
|
92
|
+
isValidISO('US'); // true
|
|
93
|
+
isValidISO('XX'); // false
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Error Handling
|
|
97
|
+
|
|
98
|
+
If you provide an invalid or unsupported ISO code, the functions will throw an error:
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
try {
|
|
102
|
+
getCountryByISO('INVALID');
|
|
103
|
+
} catch (error) {
|
|
104
|
+
console.error(error.message); // "Country with ISO code "INVALID" not found"
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## API Reference
|
|
109
|
+
|
|
110
|
+
| Function | Returns | Description |
|
|
111
|
+
| --- | --- | --- |
|
|
112
|
+
| `getCountryByISO(iso)` | `string` | Returns the full country name. |
|
|
113
|
+
| `getCurrencyByISO(iso)` | `string` | Returns the ISO currency code (e.g., USD). |
|
|
114
|
+
| `getLanguageByISO(iso)` | `string` | Returns the primary language. |
|
|
115
|
+
| `getCurrencySymbolByISO(iso)` | `string` | Returns the currency symbol (e.g., $). |
|
|
116
|
+
| `getAreaCodeByISO(iso)` | `string` | Returns the international calling code. |
|
|
117
|
+
| `getPlaceholderByISO(iso)` | `string` | Returns a sample phone number placeholder. |
|
|
118
|
+
| `getPincodeRegexByISO(iso)` | `RegExp` | Returns a Regex for postal code validation. |
|
|
119
|
+
| `getPhoneRegexByISO(iso)` | `RegExp` | Returns a Regex for phone validation (if available). |
|
|
120
|
+
| `getCenterByISO(iso)` | `object` | Returns `{ lat: number, lng: number }`. |
|
|
121
|
+
| `getTimezoneByISO(iso)` | `string` | Returns the country's primary timezone. |
|
|
122
|
+
| `getUTCOffsetByISO(iso)` | `number` | Returns the UTC offset in hours. |
|
|
123
|
+
| `formatAmountByISO(amt, iso)` | `string` | Returns formatted currency string. |
|
|
124
|
+
| `getAllISOCodes()` | `string[]` | Returns all supported ISO codes. |
|
|
125
|
+
| `getISOByName(name)` | `string \| null` | Returns ISO code for a country name. |
|
|
126
|
+
| `isValidISO(iso)` | `boolean` | Checks if an ISO code is supported. |
|
|
127
|
+
| `getAllCountries()` | `object` | Returns the entire country dataset. |
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
ISC
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const COUNTRY_CURRENCY_MAP: Record<string, {
|
|
2
|
+
iso: string;
|
|
3
|
+
country: string;
|
|
4
|
+
symbol: string;
|
|
5
|
+
currency: string;
|
|
6
|
+
areaCode: string;
|
|
7
|
+
pincodeRegex: RegExp;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
language: string;
|
|
10
|
+
center: {
|
|
11
|
+
lat: number;
|
|
12
|
+
lng: number;
|
|
13
|
+
};
|
|
14
|
+
timezone: string;
|
|
15
|
+
utcOffset: number;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COUNTRY_CURRENCY_MAP = void 0;
|
|
4
|
+
exports.COUNTRY_CURRENCY_MAP = {
|
|
5
|
+
AF: { iso: 'AF', country: 'Afghanistan', symbol: '؋', currency: 'AFN', areaCode: '+93', pincodeRegex: /^[1-9][0-9]{3}$/, placeholder: 'e.g. +93 123456789', language: 'Dari', center: { lat: 33.93911, lng: 67.709953 }, timezone: 'Asia/Kabul', utcOffset: 4.5 },
|
|
6
|
+
AL: { iso: 'AL', country: 'Albania', symbol: 'L', currency: 'ALL', areaCode: '+355', pincodeRegex: /^[1-9][0-9]{3}$/, placeholder: 'e.g. +355 123456789', language: 'Albanian', center: { lat: 41.153332, lng: 20.168331 }, timezone: 'Europe/Tirane', utcOffset: 1 },
|
|
7
|
+
DZ: { iso: 'DZ', country: 'Algeria', symbol: 'د.ج', currency: 'DZD', areaCode: '+213', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +213 123456789', language: 'Arabic', center: { lat: 28.033886, lng: 1.659626 }, timezone: 'Africa/Algiers', utcOffset: 1 },
|
|
8
|
+
AD: { iso: 'AD', country: 'Andorra', symbol: '€', currency: 'EUR', areaCode: '+376', pincodeRegex: /^AD[1-7][0-9]{2}$/, placeholder: 'e.g. +376 123456', language: 'Catalan', center: { lat: 42.546245, lng: 1.601554 }, timezone: 'Europe/Andorra', utcOffset: 1 },
|
|
9
|
+
AO: { iso: 'AO', country: 'Angola', symbol: 'Kz', currency: 'AOA', areaCode: '+244', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +244 123456789', language: 'Portuguese', center: { lat: -11.202692, lng: 17.873887 }, timezone: 'Africa/Luanda', utcOffset: 1 },
|
|
10
|
+
AG: { iso: 'AG', country: 'Antigua and Barbuda', symbol: '$', currency: 'XCD', areaCode: '+1-268', pincodeRegex: /^[A-Z][0-9][A-Z] ?[0-9][A-Z][0-9]$/, placeholder: 'e.g. +1-268 1234567', language: 'English', center: { lat: 17.060816, lng: -61.796428 }, timezone: 'America/Antigua', utcOffset: -4 },
|
|
11
|
+
AR: { iso: 'AR', country: 'Argentina', symbol: '$', currency: 'ARS', areaCode: '+54', pincodeRegex: /^[A-Z]?[0-9]{4}[A-Z]{0,3}$/, placeholder: 'e.g. +54 1234567890', language: 'Guaraní', center: { lat: -38.416097, lng: -63.616672 }, timezone: 'America/Argentina/Buenos_Aires', utcOffset: -3 },
|
|
12
|
+
AM: { iso: 'AM', country: 'Armenia', symbol: '֏', currency: 'AMD', areaCode: '+374', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +374 12345678', language: 'Armenian', center: { lat: 40.069099, lng: 45.038189 }, timezone: 'Asia/Yerevan', utcOffset: 4 },
|
|
13
|
+
AU: { iso: 'AU', country: 'Australia', symbol: '$', currency: 'AUD', areaCode: '+61', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +61 123456789', language: 'English', center: { lat: -25.274398, lng: 133.775136 }, timezone: 'Australia/Sydney', utcOffset: 10 },
|
|
14
|
+
AT: { iso: 'AT', country: 'Austria', symbol: '€', currency: 'EUR', areaCode: '+43', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +43 1234567890', language: 'German', center: { lat: 47.516231, lng: 14.550072 }, timezone: 'Europe/Vienna', utcOffset: 1 },
|
|
15
|
+
AZ: { iso: 'AZ', country: 'Azerbaijan', symbol: '₼', currency: 'AZN', areaCode: '+994', pincodeRegex: /^(AZ)?[0-9]{4}$/, placeholder: 'e.g. +994 123456789', language: 'Azerbaijani', center: { lat: 40.143105, lng: 47.576927 }, timezone: 'Asia/Baku', utcOffset: 4 },
|
|
16
|
+
BS: { iso: 'BS', country: 'Bahamas', symbol: '$', currency: 'BSD', areaCode: '+1-242', pincodeRegex: /^[A-Z]{2}[0-9]{5}$/, placeholder: 'e.g. +1-242 1234567', language: 'English', center: { lat: 25.03428, lng: -77.39628 }, timezone: 'America/Nassau', utcOffset: -5 },
|
|
17
|
+
BH: { iso: 'BH', country: 'Bahrain', symbol: '.د.ب', currency: 'BHD', areaCode: '+973', pincodeRegex: /^[0-9]{3,4}$/, placeholder: 'e.g. +973 12345678', language: 'Arabic', center: { lat: 25.930414, lng: 50.637772 }, timezone: 'Asia/Bahrain', utcOffset: 3 },
|
|
18
|
+
BD: { iso: 'BD', country: 'Bangladesh', symbol: '৳', currency: 'BDT', areaCode: '+880', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +880 1234567890', language: 'Bengali', center: { lat: 23.684994, lng: 90.356331 }, timezone: 'Asia/Dhaka', utcOffset: 6 },
|
|
19
|
+
BB: { iso: 'BB', country: 'Barbados', symbol: '$', currency: 'BBD', areaCode: '+1-246', pincodeRegex: /^BB[0-9]{5}$/, placeholder: 'e.g. +1-246 1234567', language: 'English', center: { lat: 13.193887, lng: -59.543198 }, timezone: 'America/Barbados', utcOffset: -4 },
|
|
20
|
+
BY: { iso: 'BY', country: 'Belarus', symbol: 'Br', currency: 'BYN', areaCode: '+375', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +375 123456789', language: 'Belarusian', center: { lat: 53.709807, lng: 27.953389 }, timezone: 'Europe/Minsk', utcOffset: 3 },
|
|
21
|
+
BE: { iso: 'BE', country: 'Belgium', symbol: '€', currency: 'EUR', areaCode: '+32', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +32 123456789', language: 'German', center: { lat: 50.503887, lng: 4.469936 }, timezone: 'Europe/Brussels', utcOffset: 1 },
|
|
22
|
+
BZ: { iso: 'BZ', country: 'Belize', symbol: '$', currency: 'BZD', areaCode: '+501', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +501 1234567', language: 'Belizean Creole', center: { lat: 17.189877, lng: -88.49765 }, timezone: 'America/Belize', utcOffset: -6 },
|
|
23
|
+
BJ: { iso: 'BJ', country: 'Benin', symbol: 'Fr', currency: 'XOF', areaCode: '+229', pincodeRegex: /^[0-9]{2}$/, placeholder: 'e.g. +229 12345678', language: 'French', center: { lat: 9.30769, lng: 2.315834 }, timezone: 'Africa/Porto-Novo', utcOffset: 1 },
|
|
24
|
+
BT: { iso: 'BT', country: 'Bhutan', symbol: 'Nu', currency: 'BTN', areaCode: '+975', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +975 12345678', language: 'Dzongkha', center: { lat: 27.514162, lng: 90.433601 }, timezone: 'Asia/Thimphu', utcOffset: 6 },
|
|
25
|
+
BO: { iso: 'BO', country: 'Bolivia', symbol: 'Bs', currency: 'BOB', areaCode: '+591', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +591 12345678', language: 'Aymara', center: { lat: -16.290154, lng: -63.588653 }, timezone: 'America/La_Paz', utcOffset: -4 },
|
|
26
|
+
BA: { iso: 'BA', country: 'Bosnia and Herzegovina', symbol: 'KM', currency: 'BAM', areaCode: '+387', pincodeRegex: /^[7-8][0-9]{4}$/, placeholder: 'e.g. +387 12345678', language: 'Bosnian', center: { lat: 43.915886, lng: 17.679076 }, timezone: 'Europe/Sarajevo', utcOffset: 1 },
|
|
27
|
+
BW: { iso: 'BW', country: 'Botswana', symbol: 'P', currency: 'BWP', areaCode: '+267', pincodeRegex: /^[0-9]{2}$/, placeholder: 'e.g. +267 12345678', language: 'English', center: { lat: -22.328474, lng: 24.684866 }, timezone: 'Africa/Gaborone', utcOffset: 2 },
|
|
28
|
+
BR: { iso: 'BR', country: 'Brazil', symbol: 'R$', currency: 'BRL', areaCode: '+55', pincodeRegex: /^[0-9]{5}-?[0-9]{3}$/, placeholder: 'e.g. +55 1234567890', language: 'Portuguese', center: { lat: -14.235004, lng: -51.92528 }, timezone: 'America/Sao_Paulo', utcOffset: -3 },
|
|
29
|
+
BN: { iso: 'BN', country: 'Brunei', symbol: '$', currency: 'BND', areaCode: '+673', pincodeRegex: /^[A-Z]{2}[0-9]{4}$/, placeholder: 'e.g. +673 1234567', language: 'Malay', center: { lat: 4.535277, lng: 114.727669 }, timezone: 'Asia/Brunei', utcOffset: 8 },
|
|
30
|
+
BG: { iso: 'BG', country: 'Bulgaria', symbol: 'лв', currency: 'BGN', areaCode: '+359', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +359 123456789', language: 'Bulgarian', center: { lat: 42.733883, lng: 25.48583 }, timezone: 'Europe/Sofia', utcOffset: 2 },
|
|
31
|
+
BF: { iso: 'BF', country: 'Burkina Faso', symbol: 'Fr', currency: 'XOF', areaCode: '+226', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +226 12345678', language: 'French', center: { lat: 12.238333, lng: -1.561593 }, timezone: 'Africa/Ouagadougou', utcOffset: 0 },
|
|
32
|
+
BI: { iso: 'BI', country: 'Burundi', symbol: 'Fr', currency: 'BIF', areaCode: '+257', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +257 12345678', language: 'French', center: { lat: -3.373056, lng: 29.918886 }, timezone: 'Africa/Bujumbura', utcOffset: 2 },
|
|
33
|
+
CV: { iso: 'CV', country: 'Cabo Verde', symbol: '$', currency: 'CVE', areaCode: '+238', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +238 1234567', language: 'Portuguese', center: { lat: 16.002082, lng: -24.013197 }, timezone: 'Atlantic/Cape_Verde', utcOffset: -1 },
|
|
34
|
+
KH: { iso: 'KH', country: 'Cambodia', symbol: '៛', currency: 'KHR', areaCode: '+855', pincodeRegex: /^[0-9]{5,6}$/, placeholder: 'e.g. +855 123456789', language: 'Khmer', center: { lat: 12.565679, lng: 104.990963 }, timezone: 'Asia/Phnom_Penh', utcOffset: 7 },
|
|
35
|
+
CM: { iso: 'CM', country: 'Cameroon', symbol: 'Fr', currency: 'XAF', areaCode: '+237', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +237 123456789', language: 'English', center: { lat: 7.369722, lng: 12.354722 }, timezone: 'Africa/Douala', utcOffset: 1 },
|
|
36
|
+
CA: { iso: 'CA', country: 'Canada', symbol: '$', currency: 'CAD', areaCode: '+1', pincodeRegex: /^[A-CEGHJ-NPR-TVXY][0-9][A-CEGHJ-NPR-TV-Z] ?[0-9][A-CEGHJ-NPR-TV-Z][0-9]$/, placeholder: 'e.g. +1 1234567890', language: 'English', center: { lat: 56.130366, lng: -106.346771 }, timezone: 'America/Toronto', utcOffset: -5 },
|
|
37
|
+
CF: { iso: 'CF', country: 'Central African Republic', symbol: 'Fr', currency: 'XAF', areaCode: '+236', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +236 12345678', language: 'French', center: { lat: 6.611111, lng: 20.939444 }, timezone: 'Africa/Bangui', utcOffset: 1 },
|
|
38
|
+
TD: { iso: 'TD', country: 'Chad', symbol: 'Fr', currency: 'XAF', areaCode: '+235', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +235 12345678', language: 'French', center: { lat: 15.454166, lng: 18.732207 }, timezone: 'Africa/Ndjamena', utcOffset: 1 },
|
|
39
|
+
CL: { iso: 'CL', country: 'Chile', symbol: '$', currency: 'CLP', areaCode: '+56', pincodeRegex: /^[0-9]{7}$/, placeholder: 'e.g. +56 123456789', language: 'Spanish', center: { lat: -35.675147, lng: -71.542969 }, timezone: 'America/Santiago', utcOffset: -3 },
|
|
40
|
+
CN: { iso: 'CN', country: 'China', symbol: '¥', currency: 'CNY', areaCode: '+86', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +86 1234567890', language: 'Chinese', center: { lat: 35.86166, lng: 104.195397 }, timezone: 'Asia/Shanghai', utcOffset: 8 },
|
|
41
|
+
CO: { iso: 'CO', country: 'Colombia', symbol: '$', currency: 'COP', areaCode: '+57', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +57 1234567890', language: 'Spanish', center: { lat: 4.570868, lng: -74.297333 }, timezone: 'America/Bogota', utcOffset: -5 },
|
|
42
|
+
KM: { iso: 'KM', country: 'Comoros', symbol: 'Fr', currency: 'KMF', areaCode: '+269', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +269 1234567', language: 'Arabic', center: { lat: -11.875001, lng: 43.872219 }, timezone: 'Indian/Comoro', utcOffset: 3 },
|
|
43
|
+
CG: { iso: 'CG', country: 'Congo (Republic)', symbol: 'Fr', currency: 'XAF', areaCode: '+242', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +242 123456789', language: 'French', center: { lat: -0.228021, lng: 15.827659 }, timezone: 'Africa/Brazzaville', utcOffset: 1 },
|
|
44
|
+
CD: { iso: 'CD', country: 'Congo (Democratic Republic)', symbol: 'Fr', currency: 'CDF', areaCode: '+243', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +243 123456789', language: 'French', center: { lat: -4.038333, lng: 21.758664 }, timezone: 'Africa/Kinshasa', utcOffset: 1 },
|
|
45
|
+
CR: { iso: 'CR', country: 'Costa Rica', symbol: '₡', currency: 'CRC', areaCode: '+506', pincodeRegex: /^[0-9]{4,5}$/, placeholder: 'e.g. +506 12345678', language: 'Spanish', center: { lat: 9.748917, lng: -83.753428 }, timezone: 'America/Costa_Rica', utcOffset: -6 },
|
|
46
|
+
HR: { iso: 'HR', country: 'Croatia', symbol: '€', currency: 'EUR', areaCode: '+385', pincodeRegex: /^[1-5][0-9]{4}$/, placeholder: 'e.g. +385 123456789', language: 'Croatian', center: { lat: 45.1, lng: 15.2 }, timezone: 'Europe/Zagreb', utcOffset: 1 },
|
|
47
|
+
CU: { iso: 'CU', country: 'Cuba', symbol: '$', currency: 'CUP', areaCode: '+53', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +53 12345678', language: 'Spanish', center: { lat: 21.521757, lng: -77.781167 }, timezone: 'America/Havana', utcOffset: -5 },
|
|
48
|
+
CY: { iso: 'CY', country: 'Cyprus', symbol: '€', currency: 'EUR', areaCode: '+357', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +357 12345678', language: 'Greek', center: { lat: 35.126413, lng: 33.429859 }, timezone: 'Asia/Nicosia', utcOffset: 2 },
|
|
49
|
+
CZ: { iso: 'CZ', country: 'Czech Republic', symbol: 'Kč', currency: 'CZK', areaCode: '+420', pincodeRegex: /^[0-9]{3} ?[0-9]{2}$/, placeholder: 'e.g. +420 123456789', language: 'Czech', center: { lat: 49.817492, lng: 15.472962 }, timezone: 'Europe/Prague', utcOffset: 1 },
|
|
50
|
+
DK: { iso: 'DK', country: 'Denmark', symbol: 'kr', currency: 'DKK', areaCode: '+45', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +45 12345678', language: 'Danish', center: { lat: 56.26392, lng: 9.501785 }, timezone: 'Europe/Copenhagen', utcOffset: 1 },
|
|
51
|
+
DJ: { iso: 'DJ', country: 'Djibouti', symbol: 'Fr', currency: 'DJF', areaCode: '+253', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +253 12345678', language: 'French', center: { lat: 11.825138, lng: 42.590275 }, timezone: 'Africa/Djibouti', utcOffset: 3 },
|
|
52
|
+
DM: { iso: 'DM', country: 'Dominica', symbol: '$', currency: 'XCD', areaCode: '+1-767', pincodeRegex: /^[A-Z][0-9][A-Z] ?[0-9][A-Z][0-9]$/, placeholder: 'e.g. +1-767 1234567', language: 'English', center: { lat: 15.414999, lng: -61.370976 }, timezone: 'America/Dominica', utcOffset: -4 },
|
|
53
|
+
DO: { iso: 'DO', country: 'Dominican Republic', symbol: '$', currency: 'DOP', areaCode: '+1-809', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +1-809 1234567', language: 'Spanish', center: { lat: 18.735693, lng: -70.162651 }, timezone: 'America/Santo_Domingo', utcOffset: -4 },
|
|
54
|
+
EC: { iso: 'EC', country: 'Ecuador', symbol: '$', currency: 'USD', areaCode: '+593', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +593 123456789', language: 'Spanish', center: { lat: -1.831239, lng: -78.183406 }, timezone: 'America/Guayaquil', utcOffset: -5 },
|
|
55
|
+
EG: { iso: 'EG', country: 'Egypt', symbol: '£', currency: 'EGP', areaCode: '+20', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +20 1234567890', language: 'Arabic', center: { lat: 26.820553, lng: 30.802498 }, timezone: 'Africa/Cairo', utcOffset: 2 },
|
|
56
|
+
SV: { iso: 'SV', country: 'El Salvador', symbol: '$', currency: 'USD', areaCode: '+503', pincodeRegex: /^CP-[0-9]{4}$/, placeholder: 'e.g. +503 12345678', language: 'Spanish', center: { lat: 13.794185, lng: -88.89653 }, timezone: 'America/El_Salvador', utcOffset: -6 },
|
|
57
|
+
GQ: { iso: 'GQ', country: 'Equatorial Guinea', symbol: 'Fr', currency: 'XAF', areaCode: '+240', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +240 123456789', language: 'French', center: { lat: 1.650801, lng: 10.267895 }, timezone: 'Africa/Malabo', utcOffset: 1 },
|
|
58
|
+
ER: { iso: 'ER', country: 'Eritrea', symbol: 'Nfk', currency: 'ERN', areaCode: '+291', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +291 1234567', language: 'Arabic', center: { lat: 15.179384, lng: 39.782334 }, timezone: 'Africa/Asmara', utcOffset: 3 },
|
|
59
|
+
EE: { iso: 'EE', country: 'Estonia', symbol: '€', currency: 'EUR', areaCode: '+372', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +372 12345678', language: 'Estonian', center: { lat: 58.595272, lng: 25.013607 }, timezone: 'Europe/Tallinn', utcOffset: 2 },
|
|
60
|
+
SZ: { iso: 'SZ', country: 'Eswatini', symbol: 'L', currency: 'SZL', areaCode: '+268', pincodeRegex: /^[A-Z][0-9]{3}$/, placeholder: 'e.g. +268 12345678', language: 'English', center: { lat: -26.522503, lng: 31.465866 }, timezone: 'Africa/Mbabane', utcOffset: 2 },
|
|
61
|
+
ET: { iso: 'ET', country: 'Ethiopia', symbol: 'Br', currency: 'ETB', areaCode: '+251', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +251 123456789', language: 'Amharic', center: { lat: 9.145, lng: 40.489673 }, timezone: 'Africa/Addis_Ababa', utcOffset: 3 },
|
|
62
|
+
FJ: { iso: 'FJ', country: 'Fiji', symbol: '$', currency: 'FJD', areaCode: '+679', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +679 1234567', language: 'English', center: { lat: -16.578193, lng: 179.414413 }, timezone: 'Pacific/Fiji', utcOffset: 12 },
|
|
63
|
+
FI: { iso: 'FI', country: 'Finland', symbol: '€', currency: 'EUR', areaCode: '+358', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +358 1234567890', language: 'Finnish', center: { lat: 61.92411, lng: 25.748151 }, timezone: 'Europe/Helsinki', utcOffset: 2 },
|
|
64
|
+
FR: { iso: 'FR', country: 'France', symbol: '€', currency: 'EUR', areaCode: '+33', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +33 123456789', language: 'French', center: { lat: 46.227638, lng: 2.213749 }, timezone: 'Europe/Paris', utcOffset: 1 },
|
|
65
|
+
GA: { iso: 'GA', country: 'Gabon', symbol: 'Fr', currency: 'XAF', areaCode: '+241', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +241 12345678', language: 'French', center: { lat: -0.803689, lng: 11.609444 }, timezone: 'Africa/Libreville', utcOffset: 1 },
|
|
66
|
+
GM: { iso: 'GM', country: 'Gambia', symbol: 'D', currency: 'GMD', areaCode: '+220', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +220 1234567', language: 'English', center: { lat: 13.443182, lng: -15.310139 }, timezone: 'Africa/Banjul', utcOffset: 0 },
|
|
67
|
+
GE: { iso: 'GE', country: 'Georgia', symbol: '₾', currency: 'GEL', areaCode: '+995', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +995 123456789', language: 'Georgian', center: { lat: 42.315407, lng: 43.356892 }, timezone: 'Asia/Tbilisi', utcOffset: 4 },
|
|
68
|
+
DE: { iso: 'DE', country: 'Germany', symbol: '€', currency: 'EUR', areaCode: '+49', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +49 1234567890', language: 'German', center: { lat: 51.165691, lng: 10.451526 }, timezone: 'Europe/Berlin', utcOffset: 1 },
|
|
69
|
+
GH: { iso: 'GH', country: 'Ghana', symbol: '₵', currency: 'GHS', areaCode: '+233', pincodeRegex: /^[A-Z]{2}[0-9]{4}$/, placeholder: 'e.g. +233 123456789', language: 'English', center: { lat: 7.946527, lng: -1.023194 }, timezone: 'Africa/Accra', utcOffset: 0 },
|
|
70
|
+
GR: { iso: 'GR', country: 'Greece', symbol: '€', currency: 'EUR', areaCode: '+30', pincodeRegex: /^[0-9]{3} ?[0-9]{2}$/, placeholder: 'e.g. +30 1234567890', language: 'Greek', center: { lat: 39.074208, lng: 21.824312 }, timezone: 'Europe/Athens', utcOffset: 2 },
|
|
71
|
+
GD: { iso: 'GD', country: 'Grenada', symbol: '$', currency: 'XCD', areaCode: '+1-473', pincodeRegex: /^[A-Z][0-9][A-Z] ?[0-9][A-Z][0-9]$/, placeholder: 'e.g. +1-473 1234567', language: 'English', center: { lat: 12.262776, lng: -61.604171 }, timezone: 'America/Grenada', utcOffset: -4 },
|
|
72
|
+
GT: { iso: 'GT', country: 'Guatemala', symbol: 'Q', currency: 'GTQ', areaCode: '+502', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +502 12345678', language: 'Spanish', center: { lat: 15.783471, lng: -90.230759 }, timezone: 'America/Guatemala', utcOffset: -6 },
|
|
73
|
+
GN: { iso: 'GN', country: 'Guinea', symbol: 'Fr', currency: 'GNF', areaCode: '+224', pincodeRegex: /^[0-9]{3}$/, placeholder: 'e.g. +224 123456789', language: 'French', center: { lat: 9.945587, lng: -9.696645 }, timezone: 'Africa/Conakry', utcOffset: 0 },
|
|
74
|
+
GW: { iso: 'GW', country: 'Guinea-Bissau', symbol: 'Fr', currency: 'XOF', areaCode: '+245', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +245 1234567', language: 'Portuguese', center: { lat: 11.803749, lng: -15.180413 }, timezone: 'Africa/Bissau', utcOffset: 0 },
|
|
75
|
+
GY: { iso: 'GY', country: 'Guyana', symbol: '$', currency: 'GYD', areaCode: '+592', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +592 1234567', language: 'English', center: { lat: 4.860416, lng: -58.93018 }, timezone: 'America/Guyana', utcOffset: -4 },
|
|
76
|
+
HT: { iso: 'HT', country: 'Haiti', symbol: 'G', currency: 'HTG', areaCode: '+509', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +509 12345678', language: 'French', center: { lat: 18.971187, lng: -72.285215 }, timezone: 'America/Port-au-Prince', utcOffset: -5 },
|
|
77
|
+
HN: { iso: 'HN', country: 'Honduras', symbol: 'L', currency: 'HNL', areaCode: '+504', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +504 12345678', language: 'Spanish', center: { lat: 15.199999, lng: -86.241905 }, timezone: 'America/Tegucigalpa', utcOffset: -6 },
|
|
78
|
+
HU: { iso: 'HU', country: 'Hungary', symbol: 'Ft', currency: 'HUF', areaCode: '+36', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +36 123456789', language: 'Hungarian', center: { lat: 47.162494, lng: 19.503304 }, timezone: 'Europe/Budapest', utcOffset: 1 },
|
|
79
|
+
IS: { iso: 'IS', country: 'Iceland', symbol: 'kr', currency: 'ISK', areaCode: '+354', pincodeRegex: /^[0-9]{3}$/, placeholder: 'e.g. +354 1234567', language: 'Icelandic', center: { lat: 64.963051, lng: -19.020835 }, timezone: 'Atlantic/Reykjavik', utcOffset: 0 },
|
|
80
|
+
IN: { iso: 'IN', country: 'India', symbol: '₹', currency: 'INR', areaCode: '+91', pincodeRegex: /^[1-9][0-9]{5}$/, placeholder: 'e.g. +91 1234567890', language: 'English', center: { lat: 20.593684, lng: 78.96288 }, timezone: 'Asia/Kolkata', utcOffset: 5.5 },
|
|
81
|
+
ID: { iso: 'ID', country: 'Indonesia', symbol: 'Rp', currency: 'IDR', areaCode: '+62', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +62 1234567890', language: 'Indonesian', center: { lat: -0.789275, lng: 113.921327 }, timezone: 'Asia/Jakarta', utcOffset: 7 },
|
|
82
|
+
IR: { iso: 'IR', country: 'Iran', symbol: '﷼', currency: 'IRR', areaCode: '+98', pincodeRegex: /^[0-9]{10}$/, placeholder: 'e.g. +98 1234567890', language: 'Persian (Farsi)', center: { lat: 32.427908, lng: 53.688046 }, timezone: 'Asia/Tehran', utcOffset: 3.5 },
|
|
83
|
+
IQ: { iso: 'IQ', country: 'Iraq', symbol: 'ع.د', currency: 'IQD', areaCode: '+964', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +964 1234567890', language: 'Arabic', center: { lat: 33.223191, lng: 43.679291 }, timezone: 'Asia/Baghdad', utcOffset: 3 },
|
|
84
|
+
IE: { iso: 'IE', country: 'Ireland', symbol: '€', currency: 'EUR', areaCode: '+353', pincodeRegex: /^[A-Z][0-9]{2} ?[A-Z0-9]{4}$/, placeholder: 'e.g. +353 123456789', language: 'English', center: { lat: 53.41291, lng: -8.24389 }, timezone: 'Europe/Dublin', utcOffset: 0 },
|
|
85
|
+
IL: { iso: 'IL', country: 'Israel', symbol: '₪', currency: 'ILS', areaCode: '+972', pincodeRegex: /^[0-9]{5,7}$/, placeholder: 'e.g. +972 123456789', language: 'Arabic', center: { lat: 31.046051, lng: 34.851612 }, timezone: 'Asia/Jerusalem', utcOffset: 2 },
|
|
86
|
+
IT: { iso: 'IT', country: 'Italy', symbol: '€', currency: 'EUR', areaCode: '+39', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +39 1234567890', language: 'Italian', center: { lat: 41.87194, lng: 12.56738 }, timezone: 'Europe/Rome', utcOffset: 1 },
|
|
87
|
+
JM: { iso: 'JM', country: 'Jamaica', symbol: '$', currency: 'JMD', areaCode: '+1-876', pincodeRegex: /^[A-Z]{2}[0-9]{2}$/, placeholder: 'e.g. +1-876 1234567', language: 'English', center: { lat: 18.109581, lng: -77.297508 }, timezone: 'America/Jamaica', utcOffset: -5 },
|
|
88
|
+
JP: { iso: 'JP', country: 'Japan', symbol: '¥', currency: 'JPY', areaCode: '+81', pincodeRegex: /^[0-9]{3}-?[0-9]{4}$/, placeholder: 'e.g. +81 1234567890', language: 'Japanese', center: { lat: 36.204824, lng: 138.252924 }, timezone: 'Asia/Tokyo', utcOffset: 9 },
|
|
89
|
+
JO: { iso: 'JO', country: 'Jordan', symbol: 'د.ا', currency: 'JOD', areaCode: '+962', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +962 123456789', language: 'Arabic', center: { lat: 30.585164, lng: 36.238414 }, timezone: 'Asia/Amman', utcOffset: 2 },
|
|
90
|
+
KZ: { iso: 'KZ', country: 'Kazakhstan', symbol: '₸', currency: 'KZT', areaCode: '+7', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +7 1234567890', language: 'Kazakh', center: { lat: 48.019573, lng: 66.923684 }, timezone: 'Asia/Almaty', utcOffset: 5 },
|
|
91
|
+
KE: { iso: 'KE', country: 'Kenya', symbol: 'Ksh', currency: 'KES', areaCode: '+254', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +254 123456789', language: 'English', center: { lat: -0.023559, lng: 37.906193 }, timezone: 'Africa/Nairobi', utcOffset: 3 },
|
|
92
|
+
KI: { iso: 'KI', country: 'Kiribati', symbol: '$', currency: 'AUD', areaCode: '+686', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +686 1234567', language: 'English', center: { lat: -3.370417, lng: -168.734039 }, timezone: 'Pacific/Tarawa', utcOffset: 12 },
|
|
93
|
+
KP: { iso: 'KP', country: 'North Korea', symbol: '₩', currency: 'KPW', areaCode: '+850', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +850 1234567890', language: 'Korean', center: { lat: 40.339852, lng: 127.510093 }, timezone: 'Asia/Pyongyang', utcOffset: 9 },
|
|
94
|
+
KR: { iso: 'KR', country: 'South Korea', symbol: '₩', currency: 'KRW', areaCode: '+82', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +82 1234567890', language: 'Korean', center: { lat: 35.907757, lng: 127.766922 }, timezone: 'Asia/Seoul', utcOffset: 9 },
|
|
95
|
+
KW: { iso: 'KW', country: 'Kuwait', symbol: 'د.ك', currency: 'KWD', areaCode: '+965', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +965 12345678', language: 'Arabic', center: { lat: 29.31166, lng: 47.481766 }, timezone: 'Asia/Kuwait', utcOffset: 3 },
|
|
96
|
+
KG: { iso: 'KG', country: 'Kyrgyzstan', symbol: 'с', currency: 'KGS', areaCode: '+996', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +996 123456789', language: 'Kyrgyz', center: { lat: 41.20438, lng: 74.766098 }, timezone: 'Asia/Bishkek', utcOffset: 6 },
|
|
97
|
+
LA: { iso: 'LA', country: 'Laos', symbol: '₭', currency: 'LAK', areaCode: '+856', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +856 1234567890', language: 'Lao', center: { lat: 19.85627, lng: 102.495496 }, timezone: 'Asia/Vientiane', utcOffset: 7 },
|
|
98
|
+
LV: { iso: 'LV', country: 'Latvia', symbol: '€', currency: 'EUR', areaCode: '+371', pincodeRegex: /^(LV-)?[0-9]{4}$/, placeholder: 'e.g. +371 12345678', language: 'Latvian', center: { lat: 56.879635, lng: 24.603189 }, timezone: 'Europe/Riga', utcOffset: 2 },
|
|
99
|
+
LB: { iso: 'LB', country: 'Lebanon', symbol: 'ل.ل', currency: 'LBP', areaCode: '+961', pincodeRegex: /^[0-9]{4}( ?[0-9]{4})?$/, placeholder: 'e.g. +961 12345678', language: 'Arabic', center: { lat: 33.854721, lng: 35.862285 }, timezone: 'Asia/Beirut', utcOffset: 2 },
|
|
100
|
+
LS: { iso: 'LS', country: 'Lesotho', symbol: 'L', currency: 'LSL', areaCode: '+266', pincodeRegex: /^[0-9]{3}$/, placeholder: 'e.g. +266 12345678', language: 'English', center: { lat: -29.609988, lng: 28.233608 }, timezone: 'Africa/Maseru', utcOffset: 2 },
|
|
101
|
+
LR: { iso: 'LR', country: 'Liberia', symbol: '$', currency: 'LRD', areaCode: '+231', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +231 12345678', language: 'English', center: { lat: 6.428055, lng: -9.429499 }, timezone: 'Africa/Monrovia', utcOffset: 0 },
|
|
102
|
+
LY: { iso: 'LY', country: 'Libya', symbol: 'ل.د', currency: 'LYD', areaCode: '+218', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +218 123456789', language: 'Arabic', center: { lat: 26.3351, lng: 17.228331 }, timezone: 'Africa/Tripoli', utcOffset: 2 },
|
|
103
|
+
LI: { iso: 'LI', country: 'Liechtenstein', symbol: 'Fr', currency: 'CHF', areaCode: '+423', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +423 1234567', language: 'German', center: { lat: 47.166, lng: 9.555373 }, timezone: 'Europe/Vaduz', utcOffset: 1 },
|
|
104
|
+
LT: { iso: 'LT', country: 'Lithuania', symbol: '€', currency: 'EUR', areaCode: '+370', pincodeRegex: /^(LT-)?[0-9]{5}$/, placeholder: 'e.g. +370 12345678', language: 'Lithuanian', center: { lat: 55.169438, lng: 23.881275 }, timezone: 'Europe/Vilnius', utcOffset: 2 },
|
|
105
|
+
LU: { iso: 'LU', country: 'Luxembourg', symbol: '€', currency: 'EUR', areaCode: '+352', pincodeRegex: /^(L-)?[0-9]{4}$/, placeholder: 'e.g. +352 123456789', language: 'German', center: { lat: 49.815273, lng: 6.129583 }, timezone: 'Europe/Luxembourg', utcOffset: 1 },
|
|
106
|
+
MG: { iso: 'MG', country: 'Madagascar', symbol: 'Ar', currency: 'MGA', areaCode: '+261', pincodeRegex: /^[0-9]{3}$/, placeholder: 'e.g. +261 123456789', language: 'French', center: { lat: -18.766947, lng: 46.869107 }, timezone: 'Indian/Antananarivo', utcOffset: 3 },
|
|
107
|
+
MW: { iso: 'MW', country: 'Malawi', symbol: 'MK', currency: 'MWK', areaCode: '+265', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +265 123456789', language: 'English', center: { lat: -13.254308, lng: 34.301525 }, timezone: 'Africa/Blantyre', utcOffset: 2 },
|
|
108
|
+
MY: { iso: 'MY', country: 'Malaysia', symbol: 'RM', currency: 'MYR', areaCode: '+60', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +60 1234567890', language: 'English', center: { lat: 4.210484, lng: 101.975766 }, timezone: 'Asia/Kuala_Lumpur', utcOffset: 8 },
|
|
109
|
+
MV: { iso: 'MV', country: 'Maldives', symbol: 'Rf', currency: 'MVR', areaCode: '+960', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +960 1234567', language: 'Maldivian', center: { lat: 3.202778, lng: 73.22068 }, timezone: 'Indian/Maldives', utcOffset: 5 },
|
|
110
|
+
ML: { iso: 'ML', country: 'Mali', symbol: 'Fr', currency: 'XOF', areaCode: '+223', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +223 12345678', language: 'French', center: { lat: 17.570692, lng: -3.996166 }, timezone: 'Africa/Bamako', utcOffset: 0 },
|
|
111
|
+
MT: { iso: 'MT', country: 'Malta', symbol: '€', currency: 'EUR', areaCode: '+356', pincodeRegex: /^[A-Z]{3} ?[0-9]{4}$/, placeholder: 'e.g. +356 12345678', language: 'English', center: { lat: 35.937496, lng: 14.375416 }, timezone: 'Europe/Malta', utcOffset: 1 },
|
|
112
|
+
MH: { iso: 'MH', country: 'Marshall Islands', symbol: '$', currency: 'USD', areaCode: '+692', pincodeRegex: /^969[6-7][0-9](-[0-9]{4})?$/, placeholder: 'e.g. +692 1234567', language: 'English', center: { lat: 7.131474, lng: 171.184478 }, timezone: 'Pacific/Majuro', utcOffset: 12 },
|
|
113
|
+
MR: { iso: 'MR', country: 'Mauritania', symbol: 'UM', currency: 'MRU', areaCode: '+222', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +222 12345678', language: 'Arabic', center: { lat: 21.00789, lng: -10.940835 }, timezone: 'Africa/Nouakchott', utcOffset: 0 },
|
|
114
|
+
MU: { iso: 'MU', country: 'Mauritius', symbol: '₨', currency: 'MUR', areaCode: '+230', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +230 12345678', language: 'English', center: { lat: -20.348404, lng: 57.552152 }, timezone: 'Indian/Mauritius', utcOffset: 4 },
|
|
115
|
+
MX: { iso: 'MX', country: 'Mexico', symbol: '$', currency: 'MXN', areaCode: '+52', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +52 1234567890', language: 'Spanish', center: { lat: 23.634501, lng: -102.552784 }, timezone: 'America/Mexico_City', utcOffset: -6 },
|
|
116
|
+
FM: { iso: 'FM', country: 'Micronesia', symbol: '$', currency: 'USD', areaCode: '+691', pincodeRegex: /^9694[1-4](-[0-9]{4})?$/, placeholder: 'e.g. +691 1234567', language: 'English', center: { lat: 7.425554, lng: 150.550812 }, timezone: 'Pacific/Pohnpei', utcOffset: 11 },
|
|
117
|
+
MD: { iso: 'MD', country: 'Moldova', symbol: 'L', currency: 'MDL', areaCode: '+373', pincodeRegex: /^(MD-)?[0-9]{4}$/, placeholder: 'e.g. +373 12345678', language: 'Romanian', center: { lat: 47.411631, lng: 28.369885 }, timezone: 'Europe/Chisinau', utcOffset: 2 },
|
|
118
|
+
MC: { iso: 'MC', country: 'Monaco', symbol: '€', currency: 'EUR', areaCode: '+377', pincodeRegex: /^980[0-9]{2}$/, placeholder: 'e.g. +377 12345678', language: 'French', center: { lat: 43.750298, lng: 7.412841 }, timezone: 'Europe/Monaco', utcOffset: 1 },
|
|
119
|
+
MN: { iso: 'MN', country: 'Mongolia', symbol: '₮', currency: 'MNT', areaCode: '+976', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +976 12345678', language: 'Mongolian', center: { lat: 46.862496, lng: 103.846656 }, timezone: 'Asia/Ulaanbaatar', utcOffset: 8 },
|
|
120
|
+
ME: { iso: 'ME', country: 'Montenegro', symbol: '€', currency: 'EUR', areaCode: '+382', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +382 12345678', language: 'Montenegrin', center: { lat: 42.708678, lng: 19.37439 }, timezone: 'Europe/Podgorica', utcOffset: 1 },
|
|
121
|
+
MA: { iso: 'MA', country: 'Morocco', symbol: 'د.م.', currency: 'MAD', areaCode: '+212', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +212 123456789', language: 'Arabic', center: { lat: 31.791702, lng: -7.09262 }, timezone: 'Africa/Casablanca', utcOffset: 1 },
|
|
122
|
+
MZ: { iso: 'MZ', country: 'Mozambique', symbol: 'MT', currency: 'MZN', areaCode: '+258', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +258 123456789', language: 'Portuguese', center: { lat: -18.665695, lng: 35.529562 }, timezone: 'Africa/Maputo', utcOffset: 2 },
|
|
123
|
+
MM: { iso: 'MM', country: 'Myanmar', symbol: 'K', currency: 'MMK', areaCode: '+95', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +95 123456789', language: 'Burmese', center: { lat: 21.913965, lng: 95.956223 }, timezone: 'Asia/Rangoon', utcOffset: 6.5 },
|
|
124
|
+
NA: { iso: 'NA', country: 'Namibia', symbol: '$', currency: 'NAD', areaCode: '+264', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +264 123456789', language: 'Afrikaans', center: { lat: -22.95764, lng: 18.49041 }, timezone: 'Africa/Windhoek', utcOffset: 2 },
|
|
125
|
+
NR: { iso: 'NR', country: 'Nauru', symbol: '$', currency: 'AUD', areaCode: '+674', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +674 1234567', language: 'English', center: { lat: -0.522778, lng: 166.931503 }, timezone: 'Pacific/Nauru', utcOffset: 12 },
|
|
126
|
+
NP: { iso: 'NP', country: 'Nepal', symbol: '₨', currency: 'NPR', areaCode: '+977', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +977 1234567890', language: 'Nepali', center: { lat: 28.394857, lng: 84.124008 }, timezone: 'Asia/Kathmandu', utcOffset: 5.75 },
|
|
127
|
+
NL: { iso: 'NL', country: 'Netherlands', symbol: '€', currency: 'EUR', areaCode: '+31', pincodeRegex: /^[0-9]{4} ?[A-Z]{2}$/, placeholder: 'e.g. +31 123456789', language: 'Dutch', center: { lat: 52.132633, lng: 5.291266 }, timezone: 'Europe/Amsterdam', utcOffset: 1 },
|
|
128
|
+
NZ: { iso: 'NZ', country: 'New Zealand', symbol: '$', currency: 'NZD', areaCode: '+64', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +64 123456789', language: 'English', center: { lat: -40.900557, lng: 174.885971 }, timezone: 'Pacific/Auckland', utcOffset: 12 },
|
|
129
|
+
NI: { iso: 'NI', country: 'Nicaragua', symbol: 'C$', currency: 'NIO', areaCode: '+505', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +505 12345678', language: 'Spanish', center: { lat: 12.865416, lng: -85.207229 }, timezone: 'America/Managua', utcOffset: -6 },
|
|
130
|
+
NE: { iso: 'NE', country: 'Niger', symbol: 'Fr', currency: 'XOF', areaCode: '+227', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +227 12345678', language: 'French', center: { lat: 17.607789, lng: 8.081666 }, timezone: 'Africa/Niamey', utcOffset: 1 },
|
|
131
|
+
NG: { iso: 'NG', country: 'Nigeria', symbol: '₦', currency: 'NGN', areaCode: '+234', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +234 1234567890', language: 'English', center: { lat: 9.081999, lng: 8.675277 }, timezone: 'Africa/Lagos', utcOffset: 1 },
|
|
132
|
+
MK: { iso: 'MK', country: 'North Macedonia', symbol: 'ден', currency: 'MKD', areaCode: '+389', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +389 12345678', language: 'Macedonian', center: { lat: 41.608635, lng: 21.745275 }, timezone: 'Europe/Skopje', utcOffset: 1 },
|
|
133
|
+
NO: { iso: 'NO', country: 'Norway', symbol: 'kr', currency: 'NOK', areaCode: '+47', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +47 12345678', language: 'Norwegian Nynorsk', center: { lat: 60.472024, lng: 8.468946 }, timezone: 'Europe/Oslo', utcOffset: 1 },
|
|
134
|
+
OM: { iso: 'OM', country: 'Oman', symbol: 'ر.ع.', currency: 'OMR', areaCode: '+968', pincodeRegex: /^[0-9]{3}$/, placeholder: 'e.g. +968 12345678', language: 'Arabic', center: { lat: 21.512583, lng: 55.923255 }, timezone: 'Asia/Muscat', utcOffset: 4 },
|
|
135
|
+
PK: { iso: 'PK', country: 'Pakistan', symbol: '₨', currency: 'PKR', areaCode: '+92', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +92 1234567890', language: 'English', center: { lat: 30.375321, lng: 69.345116 }, timezone: 'Asia/Karachi', utcOffset: 5 },
|
|
136
|
+
PW: { iso: 'PW', country: 'Palau', symbol: '$', currency: 'USD', areaCode: '+680', pincodeRegex: /^96940(-[0-9]{4})?$/, placeholder: 'e.g. +680 1234567', language: 'English', center: { lat: 7.51498, lng: 134.58252 }, timezone: 'Pacific/Palau', utcOffset: 9 },
|
|
137
|
+
PA: { iso: 'PA', country: 'Panama', symbol: 'B/.', currency: 'PAB', areaCode: '+507', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +507 12345678', language: 'Spanish', center: { lat: 8.537981, lng: -80.782127 }, timezone: 'America/Panama', utcOffset: -5 },
|
|
138
|
+
PG: { iso: 'PG', country: 'Papua New Guinea', symbol: 'K', currency: 'PGK', areaCode: '+675', pincodeRegex: /^[0-9]{3}$/, placeholder: 'e.g. +675 12345678', language: 'English', center: { lat: -6.314993, lng: 143.95555 }, timezone: 'Pacific/Port_Moresby', utcOffset: 10 },
|
|
139
|
+
PY: { iso: 'PY', country: 'Paraguay', symbol: '₲', currency: 'PYG', areaCode: '+595', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +595 123456789', language: 'Guaraní', center: { lat: -23.442503, lng: -58.443832 }, timezone: 'America/Asuncion', utcOffset: -4 },
|
|
140
|
+
PE: { iso: 'PE', country: 'Peru', symbol: 'S/', currency: 'PEN', areaCode: '+51', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +51 123456789', language: 'Aymara', center: { lat: -9.189967, lng: -75.015152 }, timezone: 'America/Lima', utcOffset: -5 },
|
|
141
|
+
PH: { iso: 'PH', country: 'Philippines', symbol: '₱', currency: 'PHP', areaCode: '+63', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +63 1234567890', language: 'English', center: { lat: 12.879721, lng: 121.774017 }, timezone: 'Asia/Manila', utcOffset: 8 },
|
|
142
|
+
PL: { iso: 'PL', country: 'Poland', symbol: 'zł', currency: 'PLN', areaCode: '+48', pincodeRegex: /^[0-9]{2}-[0-9]{3}$/, placeholder: 'e.g. +48 123456789', language: 'Polish', center: { lat: 51.919438, lng: 19.145136 }, timezone: 'Europe/Warsaw', utcOffset: 1 },
|
|
143
|
+
PT: { iso: 'PT', country: 'Portugal', symbol: '€', currency: 'EUR', areaCode: '+351', pincodeRegex: /^[0-9]{4}-[0-9]{3}$/, placeholder: 'e.g. +351 123456789', language: 'Portuguese', center: { lat: 39.399872, lng: -8.224454 }, timezone: 'Europe/Lisbon', utcOffset: 0 },
|
|
144
|
+
QA: { iso: 'QA', country: 'Qatar', symbol: 'ر.ق', currency: 'QAR', areaCode: '+974', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +974 12345678', language: 'Arabic', center: { lat: 25.354826, lng: 51.183884 }, timezone: 'Asia/Qatar', utcOffset: 3 },
|
|
145
|
+
RO: { iso: 'RO', country: 'Romania', symbol: 'lei', currency: 'RON', areaCode: '+40', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +40 123456789', language: 'Romanian', center: { lat: 45.943161, lng: 24.96676 }, timezone: 'Europe/Bucharest', utcOffset: 2 },
|
|
146
|
+
RU: { iso: 'RU', country: 'Russia', symbol: '₽', currency: 'RUB', areaCode: '+7', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +7 1234567890', language: 'Russian', center: { lat: 61.52401, lng: 105.318756 }, timezone: 'Europe/Moscow', utcOffset: 3 },
|
|
147
|
+
RW: { iso: 'RW', country: 'Rwanda', symbol: 'Fr', currency: 'RWF', areaCode: '+250', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +250 123456789', language: 'English', center: { lat: -1.940278, lng: 29.873888 }, timezone: 'Africa/Kigali', utcOffset: 2 },
|
|
148
|
+
KN: { iso: 'KN', country: 'Saint Kitts and Nevis', symbol: '$', currency: 'XCD', areaCode: '+1-869', pincodeRegex: /^[A-Z][0-9][A-Z] ?[0-9][A-Z][0-9]$/, placeholder: 'e.g. +1-869 1234567', language: 'English', center: { lat: 17.357822, lng: -62.782998 }, timezone: 'America/St_Kitts', utcOffset: -4 },
|
|
149
|
+
LC: { iso: 'LC', country: 'Saint Lucia', symbol: '$', currency: 'XCD', areaCode: '+1-758', pincodeRegex: /^[A-Z]{2}[0-9]{2}$/, placeholder: 'e.g. +1-758 1234567', language: 'English', center: { lat: 13.909444, lng: -60.978893 }, timezone: 'America/St_Lucia', utcOffset: -4 },
|
|
150
|
+
VC: { iso: 'VC', country: 'Saint Vincent and the Grenadines', symbol: '$', currency: 'XCD', areaCode: '+1-784', pincodeRegex: /^VC[0-9]{4}$/, placeholder: 'e.g. +1-784 1234567', language: 'English', center: { lat: 12.984305, lng: -61.287228 }, timezone: 'America/St_Vincent', utcOffset: -4 },
|
|
151
|
+
WS: { iso: 'WS', country: 'Samoa', symbol: 'T', currency: 'WST', areaCode: '+685', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +685 1234567', language: 'English', center: { lat: -13.759029, lng: -172.104629 }, timezone: 'Pacific/Apia', utcOffset: 13 },
|
|
152
|
+
SM: { iso: 'SM', country: 'San Marino', symbol: '€', currency: 'EUR', areaCode: '+378', pincodeRegex: /^4789[0-9]$/, placeholder: 'e.g. +378 1234567890', language: 'Italian', center: { lat: 43.94236, lng: 12.457777 }, timezone: 'Europe/San_Marino', utcOffset: 1 },
|
|
153
|
+
ST: { iso: 'ST', country: 'Sao Tome and Principe', symbol: 'Db', currency: 'STN', areaCode: '+239', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +239 1234567', language: 'Portuguese', center: { lat: 0.18636, lng: 6.613081 }, timezone: 'Africa/Sao_Tome', utcOffset: 0 },
|
|
154
|
+
SA: { iso: 'SA', country: 'Saudi Arabia', symbol: '﷼', currency: 'SAR', areaCode: '+966', pincodeRegex: /^[0-9]{5}(-[0-9]{4})?$/, placeholder: 'e.g. +966 123456789', language: 'Arabic', center: { lat: 23.885942, lng: 45.079162 }, timezone: 'Asia/Riyadh', utcOffset: 3 },
|
|
155
|
+
SN: { iso: 'SN', country: 'Senegal', symbol: 'Fr', currency: 'XOF', areaCode: '+221', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +221 123456789', language: 'French', center: { lat: 14.497401, lng: -14.452362 }, timezone: 'Africa/Dakar', utcOffset: 0 },
|
|
156
|
+
RS: { iso: 'RS', country: 'Serbia', symbol: 'din', currency: 'RSD', areaCode: '+381', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +381 123456789', language: 'Serbian', center: { lat: 44.016521, lng: 21.005859 }, timezone: 'Europe/Belgrade', utcOffset: 1 },
|
|
157
|
+
SC: { iso: 'SC', country: 'Seychelles', symbol: '₨', currency: 'SCR', areaCode: '+248', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +248 1234567', language: 'Seychellois Creole', center: { lat: -4.679574, lng: 55.491977 }, timezone: 'Indian/Mahe', utcOffset: 4 },
|
|
158
|
+
SL: { iso: 'SL', country: 'Sierra Leone', symbol: 'Le', currency: 'SLL', areaCode: '+232', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +232 12345678', language: 'English', center: { lat: 8.460555, lng: -11.779889 }, timezone: 'Africa/Freetown', utcOffset: 0 },
|
|
159
|
+
SG: { iso: 'SG', country: 'Singapore', symbol: '$', currency: 'SGD', areaCode: '+65', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +65 12345678', language: 'English', center: { lat: 1.352083, lng: 103.819836 }, timezone: 'Asia/Singapore', utcOffset: 8 },
|
|
160
|
+
SK: { iso: 'SK', country: 'Slovakia', symbol: '€', currency: 'EUR', areaCode: '+421', pincodeRegex: /^[0-9]{3} ?[0-9]{2}$/, placeholder: 'e.g. +421 123456789', language: 'Slovak', center: { lat: 48.669026, lng: 19.699024 }, timezone: 'Europe/Bratislava', utcOffset: 1 },
|
|
161
|
+
SI: { iso: 'SI', country: 'Slovenia', symbol: '€', currency: 'EUR', areaCode: '+386', pincodeRegex: /^(SI-)?[0-9]{4}$/, placeholder: 'e.g. +386 12345678', language: 'Slovene', center: { lat: 46.151241, lng: 14.995463 }, timezone: 'Europe/Ljubljana', utcOffset: 1 },
|
|
162
|
+
SB: { iso: 'SB', country: 'Solomon Islands', symbol: '$', currency: 'SBD', areaCode: '+677', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +677 1234567', language: 'English', center: { lat: -9.64571, lng: 160.156194 }, timezone: 'Pacific/Guadalcanal', utcOffset: 11 },
|
|
163
|
+
SO: { iso: 'SO', country: 'Somalia', symbol: 'Sh', currency: 'SOS', areaCode: '+252', pincodeRegex: /^[A-Z]{2}[0-9]{5}$/, placeholder: 'e.g. +252 12345678', language: 'Arabic', center: { lat: 5.152149, lng: 46.199616 }, timezone: 'Africa/Mogadishu', utcOffset: 3 },
|
|
164
|
+
ZA: { iso: 'ZA', country: 'South Africa', symbol: 'R', currency: 'ZAR', areaCode: '+27', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +27 123456789', language: 'Afrikaans', center: { lat: -30.559482, lng: 22.937506 }, timezone: 'Africa/Johannesburg', utcOffset: 2 },
|
|
165
|
+
SS: { iso: 'SS', country: 'South Sudan', symbol: '£', currency: 'SSP', areaCode: '+211', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +211 123456789', language: 'English', center: { lat: 6.877, lng: 31.307 }, timezone: 'Africa/Juba', utcOffset: 2 },
|
|
166
|
+
ES: { iso: 'ES', country: 'Spain', symbol: '€', currency: 'EUR', areaCode: '+34', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +34 123456789', language: 'Spanish', center: { lat: 40.463667, lng: -3.74922 }, timezone: 'Europe/Madrid', utcOffset: 1 },
|
|
167
|
+
LK: { iso: 'LK', country: 'Sri Lanka', symbol: '₨', currency: 'LKR', areaCode: '+94', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +94 123456789', language: 'Sinhala', center: { lat: 7.873054, lng: 80.771797 }, timezone: 'Asia/Colombo', utcOffset: 5.5 },
|
|
168
|
+
SD: { iso: 'SD', country: 'Sudan', symbol: 'ج.س.', currency: 'SDG', areaCode: '+249', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +249 123456789', language: 'Arabic', center: { lat: 12.862807, lng: 30.217636 }, timezone: 'Africa/Khartoum', utcOffset: 2 },
|
|
169
|
+
SR: { iso: 'SR', country: 'Suriname', symbol: '$', currency: 'SRD', areaCode: '+597', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +597 1234567', language: 'Dutch', center: { lat: 3.919305, lng: -56.027783 }, timezone: 'America/Paramaribo', utcOffset: -3 },
|
|
170
|
+
SE: { iso: 'SE', country: 'Sweden', symbol: 'kr', currency: 'SEK', areaCode: '+46', pincodeRegex: /^[0-9]{3} ?[0-9]{2}$/, placeholder: 'e.g. +46 123456789', language: 'Swedish', center: { lat: 60.128161, lng: 18.643501 }, timezone: 'Europe/Stockholm', utcOffset: 1 },
|
|
171
|
+
CH: { iso: 'CH', country: 'Switzerland', symbol: 'Fr', currency: 'CHF', areaCode: '+41', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +41 123456789', language: 'French', center: { lat: 46.818188, lng: 8.227512 }, timezone: 'Europe/Zurich', utcOffset: 1 },
|
|
172
|
+
SY: { iso: 'SY', country: 'Syria', symbol: '£', currency: 'SYP', areaCode: '+963', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +963 123456789', language: 'Arabic', center: { lat: 34.802075, lng: 38.996815 }, timezone: 'Asia/Damascus', utcOffset: 2 },
|
|
173
|
+
TW: { iso: 'TW', country: 'Taiwan', symbol: '$', currency: 'TWD', areaCode: '+886', pincodeRegex: /^[0-9]{3}([0-9]{2})?$/, placeholder: 'e.g. +886 123456789', language: 'Chinese', center: { lat: 23.69781, lng: 120.960515 }, timezone: 'Asia/Taipei', utcOffset: 8 },
|
|
174
|
+
TJ: { iso: 'TJ', country: 'Tajikistan', symbol: 'SM', currency: 'TJS', areaCode: '+992', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +992 123456789', language: 'Russian', center: { lat: 38.861034, lng: 71.276093 }, timezone: 'Asia/Dushanbe', utcOffset: 5 },
|
|
175
|
+
TZ: { iso: 'TZ', country: 'Tanzania', symbol: 'Sh', currency: 'TZS', areaCode: '+255', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +255 123456789', language: 'English', center: { lat: -6.369028, lng: 34.888822 }, timezone: 'Africa/Dar_es_Salaam', utcOffset: 3 },
|
|
176
|
+
TH: { iso: 'TH', country: 'Thailand', symbol: '฿', currency: 'THB', areaCode: '+66', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +66 123456789', language: 'Thai', center: { lat: 15.870032, lng: 100.992541 }, timezone: 'Asia/Bangkok', utcOffset: 7 },
|
|
177
|
+
TL: { iso: 'TL', country: 'Timor-Leste', symbol: '$', currency: 'USD', areaCode: '+670', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +670 12345678', language: 'Portuguese', center: { lat: -8.874217, lng: 125.727539 }, timezone: 'Asia/Dili', utcOffset: 9 },
|
|
178
|
+
TG: { iso: 'TG', country: 'Togo', symbol: 'Fr', currency: 'XOF', areaCode: '+228', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +228 12345678', language: 'French', center: { lat: 8.619543, lng: 0.824782 }, timezone: 'Africa/Lome', utcOffset: 0 },
|
|
179
|
+
TO: { iso: 'TO', country: 'Tonga', symbol: 'T$', currency: 'TOP', areaCode: '+676', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +676 1234567', language: 'English', center: { lat: -21.178986, lng: -175.198242 }, timezone: 'Pacific/Tongatapu', utcOffset: 13 },
|
|
180
|
+
TT: { iso: 'TT', country: 'Trinidad and Tobago', symbol: '$', currency: 'TTD', areaCode: '+1-868', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +1-868 1234567', language: 'English', center: { lat: 10.691803, lng: -61.222503 }, timezone: 'America/Port_of_Spain', utcOffset: -4 },
|
|
181
|
+
TN: { iso: 'TN', country: 'Tunisia', symbol: 'د.ت', currency: 'TND', areaCode: '+216', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +216 12345678', language: 'Arabic', center: { lat: 33.886917, lng: 9.537499 }, timezone: 'Africa/Tunis', utcOffset: 1 },
|
|
182
|
+
TR: { iso: 'TR', country: 'Turkey', symbol: '₺', currency: 'TRY', areaCode: '+90', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +90 1234567890', language: 'Turkish', center: { lat: 38.963745, lng: 35.243322 }, timezone: 'Europe/Istanbul', utcOffset: 3 },
|
|
183
|
+
TM: { iso: 'TM', country: 'Turkmenistan', symbol: 'T', currency: 'TMT', areaCode: '+993', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +993 12345678', language: 'Russian', center: { lat: 38.969719, lng: 59.556278 }, timezone: 'Asia/Ashgabat', utcOffset: 5 },
|
|
184
|
+
TV: { iso: 'TV', country: 'Tuvalu', symbol: '$', currency: 'AUD', areaCode: '+688', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +688 1234567', language: 'English', center: { lat: -7.109535, lng: 177.64933 }, timezone: 'Pacific/Funafuti', utcOffset: 12 },
|
|
185
|
+
UG: { iso: 'UG', country: 'Uganda', symbol: 'Sh', currency: 'UGX', areaCode: '+256', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +256 123456789', language: 'English', center: { lat: 1.373333, lng: 32.290275 }, timezone: 'Africa/Kampala', utcOffset: 3 },
|
|
186
|
+
UA: { iso: 'UA', country: 'Ukraine', symbol: '₴', currency: 'UAH', areaCode: '+380', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +380 123456789', language: 'Ukrainian', center: { lat: 48.379433, lng: 31.16558 }, timezone: 'Europe/Kyiv', utcOffset: 2 },
|
|
187
|
+
AE: { iso: 'AE', country: 'United Arab Emirates', symbol: 'د.إ', currency: 'AED', areaCode: '+971', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +971 123456789', language: 'Arabic', center: { lat: 23.424076, lng: 53.847818 }, timezone: 'Asia/Dubai', utcOffset: 4 },
|
|
188
|
+
GB: { iso: 'GB', country: 'United Kingdom', symbol: '£', currency: 'GBP', areaCode: '+44', pincodeRegex: /^[A-Z]{1,2}[0-9][0-9A-Z]? ?[0-9][A-BD-HJLNP-UW-Z]{2}$/, placeholder: 'e.g. +44 1234567890', language: 'English', center: { lat: 55.378051, lng: -3.435973 }, timezone: 'Europe/London', utcOffset: 0 },
|
|
189
|
+
US: { iso: 'US', country: 'United States', symbol: '$', currency: 'USD', areaCode: '+1', pincodeRegex: /^[0-9]{5}(-[0-9]{4})?$/, placeholder: 'e.g. +1 1234567890', language: 'English', center: { lat: 37.09024, lng: -95.712891 }, timezone: 'America/New_York', utcOffset: -5 },
|
|
190
|
+
UY: { iso: 'UY', country: 'Uruguay', symbol: '$', currency: 'UYU', areaCode: '+598', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +598 12345678', language: 'Spanish', center: { lat: -32.522779, lng: -55.765835 }, timezone: 'America/Montevideo', utcOffset: -3 },
|
|
191
|
+
UZ: { iso: 'UZ', country: 'Uzbekistan', symbol: "so\'m", currency: 'UZS', areaCode: '+998', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +998 123456789', language: 'Russian', center: { lat: 41.377491, lng: 64.585262 }, timezone: 'Asia/Tashkent', utcOffset: 5 },
|
|
192
|
+
VU: { iso: 'VU', country: 'Vanuatu', symbol: 'Vt', currency: 'VUV', areaCode: '+678', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +678 1234567', language: 'Bislama', center: { lat: -15.376706, lng: 166.959158 }, timezone: 'Pacific/Efate', utcOffset: 11 },
|
|
193
|
+
VA: { iso: 'VA', country: 'Vatican City', symbol: '€', currency: 'EUR', areaCode: '+379', pincodeRegex: /^00120$/, placeholder: 'e.g. +379 1234567890', language: 'Italian', center: { lat: 41.902916, lng: 12.453389 }, timezone: 'Europe/Vatican', utcOffset: 1 },
|
|
194
|
+
VE: { iso: 'VE', country: 'Venezuela', symbol: 'Bs.S', currency: 'VES', areaCode: '+58', pincodeRegex: /^[0-9]{4}[A-Z]?$/, placeholder: 'e.g. +58 1234567890', language: 'Spanish', center: { lat: 6.42375, lng: -66.58973 }, timezone: 'America/Caracas', utcOffset: -4 },
|
|
195
|
+
VN: { iso: 'VN', country: 'Vietnam', symbol: '₫', currency: 'VND', areaCode: '+84', pincodeRegex: /^[0-9]{6}$/, placeholder: 'e.g. +84 123456789', language: 'Vietnamese', center: { lat: 14.058324, lng: 108.277199 }, timezone: 'Asia/Ho_Chi_Minh', utcOffset: 7 },
|
|
196
|
+
YE: { iso: 'YE', country: 'Yemen', symbol: '﷼', currency: 'YER', areaCode: '+967', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +967 123456789', language: 'Arabic', center: { lat: 15.552727, lng: 48.516388 }, timezone: 'Asia/Aden', utcOffset: 3 },
|
|
197
|
+
ZM: { iso: 'ZM', country: 'Zambia', symbol: 'ZK', currency: 'ZMW', areaCode: '+260', pincodeRegex: /^[0-9]{5}$/, placeholder: 'e.g. +260 123456789', language: 'English', center: { lat: -13.133897, lng: 27.849332 }, timezone: 'Africa/Lusaka', utcOffset: 2 },
|
|
198
|
+
ZW: { iso: 'ZW', country: 'Zimbabwe', symbol: '$', currency: 'ZWL', areaCode: '+263', pincodeRegex: /^[0-9]{4}$/, placeholder: 'e.g. +263 123456789', language: 'Chibarwe', center: { lat: -19.015438, lng: 29.154857 }, timezone: 'Africa/Harare', utcOffset: 2 },
|
|
199
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get country name by ISO code
|
|
3
|
+
* @param iso - The ISO country code (e.g., 'US', 'IN')
|
|
4
|
+
* @returns The country name
|
|
5
|
+
* @throws Error if iso is missing or country not found
|
|
6
|
+
*/
|
|
7
|
+
export declare const getCountryByISO: (iso: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Get currency code by ISO code
|
|
10
|
+
* @param iso - The ISO country code
|
|
11
|
+
* @returns The currency code (e.g., 'USD', 'INR')
|
|
12
|
+
* @throws Error if iso is missing or country not found
|
|
13
|
+
*/
|
|
14
|
+
export declare const getCurrencyByISO: (iso: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Get language by ISO code
|
|
17
|
+
* @param iso - The ISO country code
|
|
18
|
+
* @returns The primary language
|
|
19
|
+
* @throws Error if iso is missing or country not found
|
|
20
|
+
*/
|
|
21
|
+
export declare const getLanguageByISO: (iso: string) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Get currency symbol by ISO code
|
|
24
|
+
* @param iso - The ISO country code
|
|
25
|
+
* @returns The currency symbol (e.g., '$', '₹')
|
|
26
|
+
* @throws Error if iso is missing or country not found
|
|
27
|
+
*/
|
|
28
|
+
export declare const getCurrencySymbolByISO: (iso: string) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Get phone number regex by ISO code
|
|
31
|
+
* @param iso - The ISO country code
|
|
32
|
+
* @returns RegExp for the phone number or null
|
|
33
|
+
* @throws Error if iso is missing or country not found
|
|
34
|
+
*/
|
|
35
|
+
export declare const getPhoneRegexByISO: (iso: string) => RegExp | null;
|
|
36
|
+
/**
|
|
37
|
+
* Get pincode/postal code regex by ISO code
|
|
38
|
+
* @param iso - The ISO country code
|
|
39
|
+
* @returns RegExp for the pincode
|
|
40
|
+
* @throws Error if iso is missing or country not found
|
|
41
|
+
*/
|
|
42
|
+
export declare const getPincodeRegexByISO: (iso: string) => RegExp | null;
|
|
43
|
+
/**
|
|
44
|
+
* Format currency amount by ISO code
|
|
45
|
+
* @param amount - The numeric amount
|
|
46
|
+
* @param iso - The ISO country code
|
|
47
|
+
* @returns Formatted string with currency symbol
|
|
48
|
+
* @throws Error if iso is missing or country not found
|
|
49
|
+
*/
|
|
50
|
+
export declare const formatAmountByISO: (amount: number | string | null | undefined, iso: string) => string;
|
|
51
|
+
/**
|
|
52
|
+
* Get area code (calling code) by ISO code
|
|
53
|
+
* @param iso - The ISO country code
|
|
54
|
+
* @returns Area code (e.g., '+91', '+1')
|
|
55
|
+
* @throws Error if iso is missing or country not found
|
|
56
|
+
*/
|
|
57
|
+
export declare const getAreaCodeByISO: (iso: string) => string;
|
|
58
|
+
/**
|
|
59
|
+
* Get phone number placeholder by ISO code
|
|
60
|
+
* @param iso - The ISO country code
|
|
61
|
+
* @returns Placeholder string
|
|
62
|
+
* @throws Error if iso is missing or country not found
|
|
63
|
+
*/
|
|
64
|
+
export declare const getPlaceholderByISO: (iso: string) => string;
|
|
65
|
+
/**
|
|
66
|
+
* Get map center coordinates by ISO code
|
|
67
|
+
* @param iso - The ISO country code
|
|
68
|
+
* @returns Object with lat and lng
|
|
69
|
+
* @throws Error if iso is missing or country not found
|
|
70
|
+
*/
|
|
71
|
+
export declare const getCenterByISO: (iso: string) => {
|
|
72
|
+
lat: number;
|
|
73
|
+
lng: number;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Get timezone by ISO code
|
|
77
|
+
* @param iso - The ISO country code
|
|
78
|
+
* @returns The primary timezone (e.g., 'Asia/Kolkata')
|
|
79
|
+
* @throws Error if iso is missing or country not found
|
|
80
|
+
*/
|
|
81
|
+
export declare const getTimezoneByISO: (iso: string) => string;
|
|
82
|
+
/**
|
|
83
|
+
* Get UTC offset by ISO code
|
|
84
|
+
* @param iso - The ISO country code
|
|
85
|
+
* @returns The UTC offset in hours (e.g., 5.5)
|
|
86
|
+
* @throws Error if iso is missing or country not found
|
|
87
|
+
*/
|
|
88
|
+
export declare const getUTCOffsetByISO: (iso: string) => number;
|
|
89
|
+
/**
|
|
90
|
+
* Get all country data
|
|
91
|
+
* @returns The complete COUNTRY_CURRENCY_MAP
|
|
92
|
+
*/
|
|
93
|
+
export declare const getAllCountries: () => Record<string, {
|
|
94
|
+
iso: string;
|
|
95
|
+
country: string;
|
|
96
|
+
symbol: string;
|
|
97
|
+
currency: string;
|
|
98
|
+
areaCode: string;
|
|
99
|
+
pincodeRegex: RegExp;
|
|
100
|
+
placeholder: string;
|
|
101
|
+
language: string;
|
|
102
|
+
center: {
|
|
103
|
+
lat: number;
|
|
104
|
+
lng: number;
|
|
105
|
+
};
|
|
106
|
+
timezone: string;
|
|
107
|
+
utcOffset: number;
|
|
108
|
+
}>;
|
|
109
|
+
/**
|
|
110
|
+
* Get all supported ISO codes
|
|
111
|
+
* @returns Array of ISO codes
|
|
112
|
+
*/
|
|
113
|
+
export declare const getAllISOCodes: () => string[];
|
|
114
|
+
/**
|
|
115
|
+
* Find ISO code by country name
|
|
116
|
+
* @param name - Full or partial country name
|
|
117
|
+
* @returns The ISO code or null if not found
|
|
118
|
+
*/
|
|
119
|
+
export declare const getISOByName: (name: string) => string | null;
|
|
120
|
+
/**
|
|
121
|
+
* Check if an ISO code is supported
|
|
122
|
+
* @param iso - The ISO code to check
|
|
123
|
+
* @returns true if supported, false otherwise
|
|
124
|
+
*/
|
|
125
|
+
export declare const isValidISO: (iso: string) => boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Main utility object containing all country functions
|
|
128
|
+
*/
|
|
129
|
+
export declare const countryUtils: {
|
|
130
|
+
getCountryByISO: (iso: string) => string;
|
|
131
|
+
getCurrencyByISO: (iso: string) => string;
|
|
132
|
+
getLanguageByISO: (iso: string) => string;
|
|
133
|
+
getCurrencySymbolByISO: (iso: string) => string;
|
|
134
|
+
getPhoneRegexByISO: (iso: string) => RegExp | null;
|
|
135
|
+
getPincodeRegexByISO: (iso: string) => RegExp | null;
|
|
136
|
+
formatAmountByISO: (amount: number | string | null | undefined, iso: string) => string;
|
|
137
|
+
getAreaCodeByISO: (iso: string) => string;
|
|
138
|
+
getPlaceholderByISO: (iso: string) => string;
|
|
139
|
+
getCenterByISO: (iso: string) => {
|
|
140
|
+
lat: number;
|
|
141
|
+
lng: number;
|
|
142
|
+
};
|
|
143
|
+
getTimezoneByISO: (iso: string) => string;
|
|
144
|
+
getUTCOffsetByISO: (iso: string) => number;
|
|
145
|
+
getAllCountries: () => Record<string, {
|
|
146
|
+
iso: string;
|
|
147
|
+
country: string;
|
|
148
|
+
symbol: string;
|
|
149
|
+
currency: string;
|
|
150
|
+
areaCode: string;
|
|
151
|
+
pincodeRegex: RegExp;
|
|
152
|
+
placeholder: string;
|
|
153
|
+
language: string;
|
|
154
|
+
center: {
|
|
155
|
+
lat: number;
|
|
156
|
+
lng: number;
|
|
157
|
+
};
|
|
158
|
+
timezone: string;
|
|
159
|
+
utcOffset: number;
|
|
160
|
+
}>;
|
|
161
|
+
getAllISOCodes: () => string[];
|
|
162
|
+
getISOByName: (name: string) => string | null;
|
|
163
|
+
isValidISO: (iso: string) => boolean;
|
|
164
|
+
};
|
|
165
|
+
export default countryUtils;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.countryUtils = exports.isValidISO = exports.getISOByName = exports.getAllISOCodes = exports.getAllCountries = exports.getUTCOffsetByISO = exports.getTimezoneByISO = exports.getCenterByISO = exports.getPlaceholderByISO = exports.getAreaCodeByISO = exports.formatAmountByISO = exports.getPincodeRegexByISO = exports.getPhoneRegexByISO = exports.getCurrencySymbolByISO = exports.getLanguageByISO = exports.getCurrencyByISO = exports.getCountryByISO = void 0;
|
|
4
|
+
const country_1 = require("./data/country");
|
|
5
|
+
/**
|
|
6
|
+
* Helper to get country configuration or throw error if not found
|
|
7
|
+
* @param iso - The ISO country code
|
|
8
|
+
* @throws Error if country not found
|
|
9
|
+
*/
|
|
10
|
+
const getCountryConfig = (iso) => {
|
|
11
|
+
const upperIso = iso.toUpperCase();
|
|
12
|
+
const config = country_1.COUNTRY_CURRENCY_MAP[upperIso];
|
|
13
|
+
if (!config) {
|
|
14
|
+
throw new Error(`Country with ISO code "${iso}" not found`);
|
|
15
|
+
}
|
|
16
|
+
return config;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Get country name by ISO code
|
|
20
|
+
* @param iso - The ISO country code (e.g., 'US', 'IN')
|
|
21
|
+
* @returns The country name
|
|
22
|
+
* @throws Error if iso is missing or country not found
|
|
23
|
+
*/
|
|
24
|
+
const getCountryByISO = (iso) => {
|
|
25
|
+
const config = getCountryConfig(iso);
|
|
26
|
+
return config.country;
|
|
27
|
+
};
|
|
28
|
+
exports.getCountryByISO = getCountryByISO;
|
|
29
|
+
/**
|
|
30
|
+
* Get currency code by ISO code
|
|
31
|
+
* @param iso - The ISO country code
|
|
32
|
+
* @returns The currency code (e.g., 'USD', 'INR')
|
|
33
|
+
* @throws Error if iso is missing or country not found
|
|
34
|
+
*/
|
|
35
|
+
const getCurrencyByISO = (iso) => {
|
|
36
|
+
const config = getCountryConfig(iso);
|
|
37
|
+
return config.currency;
|
|
38
|
+
};
|
|
39
|
+
exports.getCurrencyByISO = getCurrencyByISO;
|
|
40
|
+
/**
|
|
41
|
+
* Get language by ISO code
|
|
42
|
+
* @param iso - The ISO country code
|
|
43
|
+
* @returns The primary language
|
|
44
|
+
* @throws Error if iso is missing or country not found
|
|
45
|
+
*/
|
|
46
|
+
const getLanguageByISO = (iso) => {
|
|
47
|
+
const config = getCountryConfig(iso);
|
|
48
|
+
return config.language;
|
|
49
|
+
};
|
|
50
|
+
exports.getLanguageByISO = getLanguageByISO;
|
|
51
|
+
/**
|
|
52
|
+
* Get currency symbol by ISO code
|
|
53
|
+
* @param iso - The ISO country code
|
|
54
|
+
* @returns The currency symbol (e.g., '$', '₹')
|
|
55
|
+
* @throws Error if iso is missing or country not found
|
|
56
|
+
*/
|
|
57
|
+
const getCurrencySymbolByISO = (iso) => {
|
|
58
|
+
const config = getCountryConfig(iso);
|
|
59
|
+
return config.symbol;
|
|
60
|
+
};
|
|
61
|
+
exports.getCurrencySymbolByISO = getCurrencySymbolByISO;
|
|
62
|
+
/**
|
|
63
|
+
* Get phone number regex by ISO code
|
|
64
|
+
* @param iso - The ISO country code
|
|
65
|
+
* @returns RegExp for the phone number or null
|
|
66
|
+
* @throws Error if iso is missing or country not found
|
|
67
|
+
*/
|
|
68
|
+
const getPhoneRegexByISO = (iso) => {
|
|
69
|
+
const config = getCountryConfig(iso);
|
|
70
|
+
return config.phoneRegex || null;
|
|
71
|
+
};
|
|
72
|
+
exports.getPhoneRegexByISO = getPhoneRegexByISO;
|
|
73
|
+
/**
|
|
74
|
+
* Get pincode/postal code regex by ISO code
|
|
75
|
+
* @param iso - The ISO country code
|
|
76
|
+
* @returns RegExp for the pincode
|
|
77
|
+
* @throws Error if iso is missing or country not found
|
|
78
|
+
*/
|
|
79
|
+
const getPincodeRegexByISO = (iso) => {
|
|
80
|
+
const config = getCountryConfig(iso);
|
|
81
|
+
return config.pincodeRegex || null;
|
|
82
|
+
};
|
|
83
|
+
exports.getPincodeRegexByISO = getPincodeRegexByISO;
|
|
84
|
+
/**
|
|
85
|
+
* Format currency amount by ISO code
|
|
86
|
+
* @param amount - The numeric amount
|
|
87
|
+
* @param iso - The ISO country code
|
|
88
|
+
* @returns Formatted string with currency symbol
|
|
89
|
+
* @throws Error if iso is missing or country not found
|
|
90
|
+
*/
|
|
91
|
+
const formatAmountByISO = (amount, iso) => {
|
|
92
|
+
const config = getCountryConfig(iso);
|
|
93
|
+
if (amount === null || amount === undefined || amount === "")
|
|
94
|
+
return "-";
|
|
95
|
+
const numAmount = typeof amount === 'string' ? parseFloat(amount) : amount;
|
|
96
|
+
if (isNaN(numAmount))
|
|
97
|
+
return "-";
|
|
98
|
+
const symbol = config.symbol || "";
|
|
99
|
+
const formattedNumber = new Intl.NumberFormat('en-US', {
|
|
100
|
+
minimumFractionDigits: 2,
|
|
101
|
+
maximumFractionDigits: 2,
|
|
102
|
+
}).format(numAmount);
|
|
103
|
+
return `${symbol}${formattedNumber}`;
|
|
104
|
+
};
|
|
105
|
+
exports.formatAmountByISO = formatAmountByISO;
|
|
106
|
+
/**
|
|
107
|
+
* Get area code (calling code) by ISO code
|
|
108
|
+
* @param iso - The ISO country code
|
|
109
|
+
* @returns Area code (e.g., '+91', '+1')
|
|
110
|
+
* @throws Error if iso is missing or country not found
|
|
111
|
+
*/
|
|
112
|
+
const getAreaCodeByISO = (iso) => {
|
|
113
|
+
const config = getCountryConfig(iso);
|
|
114
|
+
return config.areaCode;
|
|
115
|
+
};
|
|
116
|
+
exports.getAreaCodeByISO = getAreaCodeByISO;
|
|
117
|
+
/**
|
|
118
|
+
* Get phone number placeholder by ISO code
|
|
119
|
+
* @param iso - The ISO country code
|
|
120
|
+
* @returns Placeholder string
|
|
121
|
+
* @throws Error if iso is missing or country not found
|
|
122
|
+
*/
|
|
123
|
+
const getPlaceholderByISO = (iso) => {
|
|
124
|
+
const config = getCountryConfig(iso);
|
|
125
|
+
return config.placeholder;
|
|
126
|
+
};
|
|
127
|
+
exports.getPlaceholderByISO = getPlaceholderByISO;
|
|
128
|
+
/**
|
|
129
|
+
* Get map center coordinates by ISO code
|
|
130
|
+
* @param iso - The ISO country code
|
|
131
|
+
* @returns Object with lat and lng
|
|
132
|
+
* @throws Error if iso is missing or country not found
|
|
133
|
+
*/
|
|
134
|
+
const getCenterByISO = (iso) => {
|
|
135
|
+
const config = getCountryConfig(iso);
|
|
136
|
+
return config.center;
|
|
137
|
+
};
|
|
138
|
+
exports.getCenterByISO = getCenterByISO;
|
|
139
|
+
/**
|
|
140
|
+
* Get timezone by ISO code
|
|
141
|
+
* @param iso - The ISO country code
|
|
142
|
+
* @returns The primary timezone (e.g., 'Asia/Kolkata')
|
|
143
|
+
* @throws Error if iso is missing or country not found
|
|
144
|
+
*/
|
|
145
|
+
const getTimezoneByISO = (iso) => {
|
|
146
|
+
const config = getCountryConfig(iso);
|
|
147
|
+
return config.timezone;
|
|
148
|
+
};
|
|
149
|
+
exports.getTimezoneByISO = getTimezoneByISO;
|
|
150
|
+
/**
|
|
151
|
+
* Get UTC offset by ISO code
|
|
152
|
+
* @param iso - The ISO country code
|
|
153
|
+
* @returns The UTC offset in hours (e.g., 5.5)
|
|
154
|
+
* @throws Error if iso is missing or country not found
|
|
155
|
+
*/
|
|
156
|
+
const getUTCOffsetByISO = (iso) => {
|
|
157
|
+
const config = getCountryConfig(iso);
|
|
158
|
+
return config.utcOffset;
|
|
159
|
+
};
|
|
160
|
+
exports.getUTCOffsetByISO = getUTCOffsetByISO;
|
|
161
|
+
/**
|
|
162
|
+
* Get all country data
|
|
163
|
+
* @returns The complete COUNTRY_CURRENCY_MAP
|
|
164
|
+
*/
|
|
165
|
+
const getAllCountries = () => {
|
|
166
|
+
return country_1.COUNTRY_CURRENCY_MAP;
|
|
167
|
+
};
|
|
168
|
+
exports.getAllCountries = getAllCountries;
|
|
169
|
+
/**
|
|
170
|
+
* Get all supported ISO codes
|
|
171
|
+
* @returns Array of ISO codes
|
|
172
|
+
*/
|
|
173
|
+
const getAllISOCodes = () => {
|
|
174
|
+
return Object.keys(country_1.COUNTRY_CURRENCY_MAP);
|
|
175
|
+
};
|
|
176
|
+
exports.getAllISOCodes = getAllISOCodes;
|
|
177
|
+
/**
|
|
178
|
+
* Find ISO code by country name
|
|
179
|
+
* @param name - Full or partial country name
|
|
180
|
+
* @returns The ISO code or null if not found
|
|
181
|
+
*/
|
|
182
|
+
const getISOByName = (name) => {
|
|
183
|
+
const searchName = name.toLowerCase();
|
|
184
|
+
const entry = Object.entries(country_1.COUNTRY_CURRENCY_MAP).find(([_, data]) => data.country.toLowerCase() === searchName);
|
|
185
|
+
return entry ? entry[0] : null;
|
|
186
|
+
};
|
|
187
|
+
exports.getISOByName = getISOByName;
|
|
188
|
+
/**
|
|
189
|
+
* Check if an ISO code is supported
|
|
190
|
+
* @param iso - The ISO code to check
|
|
191
|
+
* @returns true if supported, false otherwise
|
|
192
|
+
*/
|
|
193
|
+
const isValidISO = (iso) => {
|
|
194
|
+
return !!country_1.COUNTRY_CURRENCY_MAP[iso.toUpperCase()];
|
|
195
|
+
};
|
|
196
|
+
exports.isValidISO = isValidISO;
|
|
197
|
+
/**
|
|
198
|
+
* Main utility object containing all country functions
|
|
199
|
+
*/
|
|
200
|
+
exports.countryUtils = {
|
|
201
|
+
getCountryByISO: exports.getCountryByISO,
|
|
202
|
+
getCurrencyByISO: exports.getCurrencyByISO,
|
|
203
|
+
getLanguageByISO: exports.getLanguageByISO,
|
|
204
|
+
getCurrencySymbolByISO: exports.getCurrencySymbolByISO,
|
|
205
|
+
getPhoneRegexByISO: exports.getPhoneRegexByISO,
|
|
206
|
+
getPincodeRegexByISO: exports.getPincodeRegexByISO,
|
|
207
|
+
formatAmountByISO: exports.formatAmountByISO,
|
|
208
|
+
getAreaCodeByISO: exports.getAreaCodeByISO,
|
|
209
|
+
getPlaceholderByISO: exports.getPlaceholderByISO,
|
|
210
|
+
getCenterByISO: exports.getCenterByISO,
|
|
211
|
+
getTimezoneByISO: exports.getTimezoneByISO,
|
|
212
|
+
getUTCOffsetByISO: exports.getUTCOffsetByISO,
|
|
213
|
+
getAllCountries: exports.getAllCountries,
|
|
214
|
+
getAllISOCodes: exports.getAllISOCodes,
|
|
215
|
+
getISOByName: exports.getISOByName,
|
|
216
|
+
isValidISO: exports.isValidISO
|
|
217
|
+
};
|
|
218
|
+
exports.default = exports.countryUtils;
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "world-country-utils",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Utility functions for working with country data",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"start": "node dist/index.js",
|
|
13
|
+
"dev": "ts-node src/index.ts",
|
|
14
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"country",
|
|
18
|
+
"utils",
|
|
19
|
+
"typescript"
|
|
20
|
+
],
|
|
21
|
+
"author": "",
|
|
22
|
+
"license": "ISC",
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^20.0.0",
|
|
25
|
+
"ts-node": "^10.9.1",
|
|
26
|
+
"typescript": "^5.0.0"
|
|
27
|
+
}
|
|
28
|
+
}
|