country-codes-list 1.6.10 → 1.6.11
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/countriesData.js +20 -4
- package/index.d.ts +34 -28
- package/package.json +2 -2
package/countriesData.js
CHANGED
|
@@ -935,9 +935,9 @@ module.exports = [
|
|
|
935
935
|
"currencyNameEn": "Euro",
|
|
936
936
|
"tinType": "NIF (CIF)",
|
|
937
937
|
"tinName": "Número de Identificación Fiscal (formerly named Código de Identificación Fiscal)",
|
|
938
|
-
"officialLanguageCode": "
|
|
939
|
-
"officialLanguageNameEn": "",
|
|
940
|
-
"officialLanguageNameLocal": "",
|
|
938
|
+
"officialLanguageCode": "es",
|
|
939
|
+
"officialLanguageNameEn": "Spanish, Castilian",
|
|
940
|
+
"officialLanguageNameLocal": "Español",
|
|
941
941
|
"countryCallingCode": "34",
|
|
942
942
|
"areaCodes": [],
|
|
943
943
|
"region": "Europe",
|
|
@@ -1455,6 +1455,22 @@ module.exports = [
|
|
|
1455
1455
|
"region": "Asia & Pacific",
|
|
1456
1456
|
"flag": "🇮🇳"
|
|
1457
1457
|
},
|
|
1458
|
+
{
|
|
1459
|
+
"countryNameEn": "British Indian Ocean Territories",
|
|
1460
|
+
"countryNameLocal": "British Indian Ocean Territories",
|
|
1461
|
+
"countryCode": "IO",
|
|
1462
|
+
"currencyCode": "USD",
|
|
1463
|
+
"currencyNameEn": "United States dollar",
|
|
1464
|
+
"tinType": "",
|
|
1465
|
+
"tinName": "",
|
|
1466
|
+
"officialLanguageCode": "en",
|
|
1467
|
+
"officialLanguageNameEn": "English",
|
|
1468
|
+
"officialLanguageNameLocal": "English",
|
|
1469
|
+
"countryCallingCode": "246",
|
|
1470
|
+
"areaCodes": [],
|
|
1471
|
+
"region": "Indian Ocean",
|
|
1472
|
+
"flag": "🇮🇴",
|
|
1473
|
+
},
|
|
1458
1474
|
{
|
|
1459
1475
|
"countryNameEn": "Iraq",
|
|
1460
1476
|
"countryNameLocal": "العراق, Iraq",
|
|
@@ -3962,7 +3978,7 @@ module.exports = [
|
|
|
3962
3978
|
"officialLanguageCode": "en",
|
|
3963
3979
|
"officialLanguageNameEn": "English",
|
|
3964
3980
|
"officialLanguageNameLocal": "English",
|
|
3965
|
-
"countryCallingCode": "
|
|
3981
|
+
"countryCallingCode": "1",
|
|
3966
3982
|
"areaCodes": [],
|
|
3967
3983
|
"region": "Pacific Ocean",
|
|
3968
3984
|
"flag": "🇺🇲",
|
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// by jakeisnt, Feb. 2022
|
|
3
3
|
|
|
4
4
|
declare module 'country-codes-list' {
|
|
5
|
-
enum CountryProperty {
|
|
5
|
+
export enum CountryProperty {
|
|
6
6
|
countryNameEn = 'countryNameEn',
|
|
7
7
|
countryNameLocal = 'countryNameLocal',
|
|
8
8
|
countryCode = 'countryCode',
|
|
@@ -19,43 +19,49 @@ declare module 'country-codes-list' {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
type CountryData = {
|
|
22
|
-
[CountryProperty.countryNameEn]: string
|
|
23
|
-
[CountryProperty.countryNameLocal]: string
|
|
24
|
-
[CountryProperty.countryCode]: string
|
|
25
|
-
[CountryProperty.currencyCode]: string
|
|
26
|
-
[CountryProperty.currencyNameEn]: string
|
|
27
|
-
[CountryProperty.tinType]: string
|
|
28
|
-
[CountryProperty.tinName]: string
|
|
29
|
-
[CountryProperty.officialLanguageCode]: string
|
|
30
|
-
[CountryProperty.officialLanguageNameEn]: string
|
|
31
|
-
[CountryProperty.officialLanguageNameLocal]: string
|
|
32
|
-
[CountryProperty.countryCallingCode]: string
|
|
33
|
-
[CountryProperty.region]: string
|
|
34
|
-
[CountryProperty.flag]: string
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type Filter<T> = (element: T, index: number, array: T[]) => T[]
|
|
22
|
+
[CountryProperty.countryNameEn]: string
|
|
23
|
+
[CountryProperty.countryNameLocal]: string
|
|
24
|
+
[CountryProperty.countryCode]: string
|
|
25
|
+
[CountryProperty.currencyCode]: string
|
|
26
|
+
[CountryProperty.currencyNameEn]: string
|
|
27
|
+
[CountryProperty.tinType]: string
|
|
28
|
+
[CountryProperty.tinName]: string
|
|
29
|
+
[CountryProperty.officialLanguageCode]: string
|
|
30
|
+
[CountryProperty.officialLanguageNameEn]: string
|
|
31
|
+
[CountryProperty.officialLanguageNameLocal]: string
|
|
32
|
+
[CountryProperty.countryCallingCode]: string
|
|
33
|
+
[CountryProperty.region]: string
|
|
34
|
+
[CountryProperty.flag]: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type Filter<T> = (element: T, index: number, array: T[]) => T[]
|
|
38
38
|
|
|
39
39
|
type CustomArraySettings = {
|
|
40
|
-
sortDataBy?: CountryProperty
|
|
41
|
-
sortBy?: any
|
|
42
|
-
filter?: Filter<CountryData
|
|
43
|
-
}
|
|
40
|
+
sortDataBy?: CountryProperty
|
|
41
|
+
sortBy?: any
|
|
42
|
+
filter?: Filter<CountryData>
|
|
43
|
+
}
|
|
44
44
|
|
|
45
|
-
export function all(): CountryData[]
|
|
45
|
+
export function all(): CountryData[]
|
|
46
46
|
|
|
47
|
-
export function filter(
|
|
47
|
+
export function filter(
|
|
48
|
+
countryProperty: CountryProperty,
|
|
49
|
+
value: string,
|
|
50
|
+
): CountryData[]
|
|
48
51
|
|
|
49
|
-
export function findOne(
|
|
52
|
+
export function findOne(
|
|
53
|
+
countryProperty: CountryProperty,
|
|
54
|
+
value: string,
|
|
55
|
+
): CountryData
|
|
50
56
|
|
|
51
57
|
export function customArray(
|
|
52
|
-
fields?:
|
|
53
|
-
settings?: CustomArraySettings
|
|
54
|
-
): string[]
|
|
58
|
+
fields?: Record<string, string>,
|
|
59
|
+
settings?: CustomArraySettings,
|
|
60
|
+
): Record<string, string>[]
|
|
55
61
|
|
|
56
62
|
export function customList(
|
|
57
63
|
key?: CountryProperty,
|
|
58
64
|
label?: string,
|
|
59
65
|
settings?: CustomArraySettings,
|
|
60
|
-
): { [CountryProperty]: string }
|
|
66
|
+
): { [key in CountryProperty]: string }
|
|
61
67
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "country-codes-list",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.11",
|
|
4
4
|
"description": "List of codes per country (languages, calling codes, currency codes, etc)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"test": "echo \"Error: no test specified\"
|
|
8
|
+
"test": "echo \"Error: no test specified\""
|
|
9
9
|
},
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|