countrynormalizer 0.2.9 → 0.3.0
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 +31 -2
- package/dist/index.js +3962 -2911
- package/dist/src/utils/languageValidator.d.ts +8 -0
- package/dist/types/core.d.ts +3 -1
- package/package.json +2 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates if a given language matches any of the country's languages.
|
|
3
|
+
*
|
|
4
|
+
* @param langSearch - The language to search for.
|
|
5
|
+
* @param countryLangs - The list of languages supported by the country.
|
|
6
|
+
* @returns `true` if a match is found, `false` otherwise.
|
|
7
|
+
*/
|
|
8
|
+
export declare const hasMatchingLanguage: (langSearch: string, countryLangs: string[]) => boolean;
|
package/dist/types/core.d.ts
CHANGED
|
@@ -8,12 +8,14 @@ export interface AllCountryFields {
|
|
|
8
8
|
demonym_male: string;
|
|
9
9
|
demonym_female: string;
|
|
10
10
|
gendered_demonym: boolean;
|
|
11
|
+
official_languages: string[];
|
|
12
|
+
lang_defacto: boolean;
|
|
11
13
|
tld: string;
|
|
12
14
|
flag_emoji: string;
|
|
13
15
|
calling_code: string[];
|
|
14
16
|
continent: string;
|
|
15
17
|
}
|
|
16
|
-
export type ContactCountryFields = Pick<AllCountryFields, "tld" | "flag_emoji" | "calling_code">;
|
|
18
|
+
export type ContactCountryFields = Pick<AllCountryFields, "tld" | "flag_emoji" | "calling_code" | "official_languages" | "lang_defacto">;
|
|
17
19
|
export declare enum ContinentNames {
|
|
18
20
|
NorthAmerica = "north_america",
|
|
19
21
|
Asia = "asia",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "countrynormalizer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "ISO 3166 country data lookup and normalization. Convert between alpha-2, alpha-3, ISO numbers, country names, calling codes, flag emojis, TLDs, continents, and demonyms.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"type": "git",
|
|
54
54
|
"url": "git+https://github.com/JackMcE/CountryNormalizer.git"
|
|
55
55
|
},
|
|
56
|
-
"homepage": "https://www.countrynormalizer.xyz
|
|
56
|
+
"homepage": "https://www.countrynormalizer.xyz",
|
|
57
57
|
"bugs": {
|
|
58
58
|
"url": "https://github.com/JackMcE/CountryNormalizer/issues"
|
|
59
59
|
},
|