Skip to content

Commit 1327f61

Browse files
committed
Add RFC4646 language codes; Fix issue #10 by updating index to export with named exports
1 parent 6a8d36b commit 1327f61

4 files changed

Lines changed: 163 additions & 24 deletions

File tree

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
const Rfc4646LanguageCodes = {
2+
AF_ZA: "af-ZA", // Afrikaans - South Africa
3+
SQ_AL: "sq-AL", // Albanian - Albania
4+
AR_DZ: "ar-DZ", // Arabic - Algeria
5+
AR_BH: "ar-BH", // Arabic - Bahrain
6+
AR_EG: "ar-EG", // Arabic - Egypt
7+
AR_IQ: "ar-IQ", // Arabic - Iraq
8+
AR_JO: "ar-JO", // Arabic - Jordan
9+
AR_KW: "ar-KW", // Arabic - Kuwait
10+
AR_LB: "ar-LB", // Arabic - Lebanon
11+
AR_LY: "ar-LY", // Arabic - Libya
12+
AR_MA: "ar-MA", // Arabic - Morocco
13+
AR_OM: "ar-OM", // Arabic - Oman
14+
AR_QA: "ar-QA", // Arabic - Qatar
15+
AR_SA: "ar-SA", // Arabic - Saudi Arabia
16+
AR_SY: "ar-SY", // Arabic - Syria
17+
AR_TN: "ar-TN", // Arabic - Tunisia
18+
AR_AE: "ar-AE", // Arabic - United Arab Emirates
19+
AR_YE: "ar-YE", // Arabic - Yemen
20+
HY_AM: "hy-AM", // Armenian - Armenia
21+
CY_AZ_AZ: "Cy-az-AZ", // Azeri (Cyrillic) - Azerbaijan
22+
LT_AZ_AZ: "Lt-az-AZ", // Azeri (Latin) - Azerbaijan
23+
EU_ES: "eu-ES", // Basque - Basque
24+
BE_BY: "be-BY", // Belarusian - Belarus
25+
BG_BG: "bg-BG", // Bulgarian - Bulgaria
26+
CA_ES: "ca-ES", // Catalan - Catalan
27+
ZH_CN: "zh-CN", // Chinese - China
28+
ZH_HK: "zh-HK", // Chinese - Hong Kong SAR
29+
ZH_MO: "zh-MO", // Chinese - Macau SAR
30+
ZH_SG: "zh-SG", // Chinese - Singapore
31+
ZH_TW: "zh-TW", // Chinese - Taiwan
32+
ZH_CHS: "zh-CHS", // Chinese (Simplified)
33+
ZH_CHT: "zh-CHT", // Chinese (Traditional)
34+
HR_HR: "hr-HR", // Croatian - Croatia
35+
CS_CZ: "cs-CZ", // Czech - Czech Republic
36+
DA_DK: "da-DK", // Danish - Denmark
37+
DIV_MV: "div-MV", // Dhivehi - Maldives
38+
NL_BE: "nl-BE", // Dutch - Belgium
39+
NL_NL: "nl-NL", // Dutch - The Netherlands
40+
EN_AU: "en-AU", // English - Australia
41+
EN_BZ: "en-BZ", // English - Belize
42+
EN_CA: "en-CA", // English - Canada
43+
EN_CB: "en-CB", // English - Caribbean
44+
EN_IE: "en-IE", // English - Ireland
45+
EN_JM: "en-JM", // English - Jamaica
46+
EN_NZ: "en-NZ", // English - New Zealand
47+
EN_PH: "en-PH", // English - Philippines
48+
EN_ZA: "en-ZA", // English - South Africa
49+
EN_TT: "en-TT", // English - Trinidad and Tobago
50+
EN_GB: "en-GB", // English - United Kingdom
51+
EN_US: "en-US", // English - United States
52+
EN_ZW: "en-ZW", // English - Zimbabwe
53+
ET_EE: "et-EE", // Estonian - Estonia
54+
FO_FO: "fo-FO", // Faroese - Faroe Islands
55+
FA_IR: "fa-IR", // Farsi - Iran
56+
FI_FI: "fi-FI", // Finnish - Finland
57+
FR_BE: "fr-BE", // French - Belgium
58+
FR_CA: "fr-CA", // French - Canada
59+
FR_FR: "fr-FR", // French - France
60+
FR_LU: "fr-LU", // French - Luxembourg
61+
FR_MC: "fr-MC", // French - Monaco
62+
FR_CH: "fr-CH", // French - Switzerland
63+
GL_ES: "gl-ES", // Galician - Galician
64+
KA_GE: "ka-GE", // Georgian - Georgia
65+
DE_AT: "de-AT", // German - Austria
66+
DE_DE: "de-DE", // German - Germany
67+
DE_LI: "de-LI", // German - Liechtenstein
68+
DE_LU: "de-LU", // German - Luxembourg
69+
DE_CH: "de-CH", // German - Switzerland
70+
EL_GR: "el-GR", // Greek - Greece
71+
GU_IN: "gu-IN", // Gujarati - India
72+
HE_IL: "he-IL", // Hebrew - Israel
73+
HI_IN: "hi-IN", // Hindi - India
74+
HU_HU: "hu-HU", // Hungarian - Hungary
75+
IS_IS: "is-IS", // Icelandic - Iceland
76+
ID_ID: "id-ID", // Indonesian - Indonesia
77+
IT_IT: "it-IT", // Italian - Italy
78+
IT_CH: "it-CH", // Italian - Switzerland
79+
JA_JP: "ja-JP", // Japanese - Japan
80+
KN_IN: "kn-IN", // Kannada - India
81+
KK_KZ: "kk-KZ", // Kazakh - Kazakhstan
82+
KOK_IN: "kok-IN", // Konkani - India
83+
KO_KR: "ko-KR", // Korean - Korea
84+
KY_KZ: "ky-KZ", // Kyrgyz - Kazakhstan
85+
LV_LV: "lv-LV", // Latvian - Latvia
86+
LT_LT: "lt-LT", // Lithuanian - Lithuania
87+
MK_MK: "mk-MK", // Macedonian (FYROM)
88+
MS_BN: "ms-BN", // Malay - Brunei
89+
MS_MY: "ms-MY", // Malay - Malaysia
90+
MR_IN: "mr-IN", // Marathi - India
91+
MN_MN: "mn-MN", // Mongolian - Mongolia
92+
NB_NO: "nb-NO", // Norwegian (Bokmål) - Norway
93+
NN_NO: "nn-NO", // Norwegian (Nynorsk) - Norway
94+
PL_PL: "pl-PL", // Polish - Poland
95+
PT_BR: "pt-BR", // Portuguese - Brazil
96+
PT_PT: "pt-PT", // Portuguese - Portugal
97+
PA_IN: "pa-IN", // Punjabi - India
98+
RO_RO: "ro-RO", // Romanian - Romania
99+
RU_RU: "ru-RU", // Russian - Russia
100+
SA_IN: "sa-IN", // Sanskrit - India
101+
CY_SR_SP: "Cy-sr-SP", // Serbian (Cyrillic) - Serbia
102+
LT_SR_SP: "Lt-sr-SP", // Serbian (Latin) - Serbia
103+
SK_SK: "sk-SK", // Slovak - Slovakia
104+
SL_SI: "sl-SI", // Slovenian - Slovenia
105+
ES_AR: "es-AR", // Spanish - Argentina
106+
ES_BO: "es-BO", // Spanish - Bolivia
107+
ES_CL: "es-CL", // Spanish - Chile
108+
ES_CO: "es-CO", // Spanish - Colombia
109+
ES_CR: "es-CR", // Spanish - Costa Rica
110+
ES_DO: "es-DO", // Spanish - Dominican Republic
111+
ES_EC: "es-EC", // Spanish - Ecuador
112+
ES_SV: "es-SV", // Spanish - El Salvador
113+
ES_GT: "es-GT", // Spanish - Guatemala
114+
ES_HN: "es-HN", // Spanish - Honduras
115+
ES_MX: "es-MX", // Spanish - Mexico
116+
ES_NI: "es-NI", // Spanish - Nicaragua
117+
ES_PA: "es-PA", // Spanish - Panama
118+
ES_PY: "es-PY", // Spanish - Paraguay
119+
ES_PE: "es-PE", // Spanish - Peru
120+
ES_PR: "es-PR", // Spanish - Puerto Rico
121+
ES_ES: "es-ES", // Spanish - Spain
122+
ES_UY: "es-UY", // Spanish - Uruguay
123+
ES_VE: "es-VE", // Spanish - Venezuela
124+
SW_KE: "sw-KE", // Swahili - Kenya
125+
SV_FI: "sv-FI", // Swedish - Finland
126+
SV_SE: "sv-SE", // Swedish - Sweden
127+
SYR_SY: "syr-SY", // Syriac - Syria
128+
TA_IN: "ta-IN", // Tamil - India
129+
TT_RU: "tt-RU", // Tatar - Russia
130+
TE_IN: "te-IN", // Telugu - India
131+
TH_TH: "th-TH", // Thai - Thailand
132+
TR_TR: "tr-TR", // Turkish - Turkey
133+
UK_UA: "uk-UA", // Ukrainian - Ukraine
134+
UR_PK: "ur-PK", // Urdu - Pakistan
135+
CY_UZ_UZ: "Cy-uz-UZ", // Uzbek (Cyrillic) - Uzbekistan
136+
LT_UZ_UZ: "Lt-uz-UZ", // Uzbek (Latin) - Uzbekistan
137+
VI_VN: "vi-VN", // Vietnamese - Vietnam
138+
};
139+
140+
export { Rfc4646LanguageCodes };

src/index.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,61 @@
22
// #region Constants
33
// -----------------------------------------------------------------------------------------
44

5-
export * from "./constants/video-resolutions";
5+
export { Rfc4646LanguageCodes } from "./constants/rfc4646-language-codes";
6+
export { VideoResolutions } from "./constants/video-resolutions";
67

78
//#endregion Constants
89

910
// -----------------------------------------------------------------------------------------
1011
// #region Enumerations
1112
// -----------------------------------------------------------------------------------------
1213

13-
export * from "./enumerations/content-type";
14-
export * from "./enumerations/error-type";
15-
export * from "./enumerations/http-header";
16-
export * from "./enumerations/http-verb";
14+
export { ContentType } from "./enumerations/content-type";
15+
export { ErrorType } from "./enumerations/error-type";
16+
export { HttpHeader } from "./enumerations/http-header";
17+
export { HttpVerb } from "./enumerations/http-verb";
1718

1819
//#endregion Enumerations
1920

2021
// -----------------------------------------------------------------------------------------
2122
// #region Interfaces
2223
// -----------------------------------------------------------------------------------------
2324

24-
export * from "./interfaces/key-value-pair";
25-
export * from "./interfaces/paged-result";
26-
export * from "./interfaces/result";
27-
export * from "./interfaces/result-error";
28-
export * from "./interfaces/service-response";
25+
export { KeyValuePair } from "./interfaces/key-value-pair";
26+
export { PagedResult } from "./interfaces/paged-result";
27+
export { Result } from "./interfaces/result";
28+
export { ResultError } from "./interfaces/result-error";
29+
export { ServiceResponse } from "./interfaces/service-response";
2930

3031
//#endregion Interfaces
3132

3233
// -----------------------------------------------------------------------------------------
3334
// #region Types
3435
// -----------------------------------------------------------------------------------------
3536

36-
export * from "./types/cancellable-promise";
37+
export { CancellablePromise } from "./types/cancellable-promise";
3738

3839
//#endregion Types
3940

4041
// -----------------------------------------------------------------------------------------
4142
// #region Utilities
4243
// -----------------------------------------------------------------------------------------
4344

44-
export * from "./utilities/collection-utils";
45-
export * from "./utilities/core-utils";
46-
export * from "./utilities/environment-utils";
47-
export * from "./utilities/promise-factory";
48-
export * from "./utilities/route-utils";
49-
export * from "./utilities/service-utils";
50-
export * from "./utilities/string-utils";
45+
export { CollectionUtils } from "./utilities/collection-utils";
46+
export { CoreUtils } from "./utilities/core-utils";
47+
export { EnvironmentUtils } from "./utilities/environment-utils";
48+
export { PromiseFactory } from "./utilities/promise-factory";
49+
export { RouteUtils } from "./utilities/route-utils";
50+
export { ServiceUtils } from "./utilities/service-utils";
51+
export { StringUtils } from "./utilities/string-utils";
5152

5253
//#endregion Utilities
5354

5455
// -----------------------------------------------------------------------------------------
5556
// #region View Models
5657
// -----------------------------------------------------------------------------------------
5758

58-
export * from "./view-models/result-record";
59-
export * from "./view-models/result-error-record";
59+
export { ResultRecord } from "./view-models/result-record";
60+
export { ResultErrorRecord } from "./view-models/result-error-record";
6061

6162
//#endregion View Models

src/utilities/string-utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import StringUtils from "./string-utils";
1+
import { StringUtils } from "./string-utils";
22

33
describe("StringUtils", () => {
44
// -------------------------------------------------------------------------------------------------

src/utilities/string-utils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const truncateRight = (value: string, truncateAtPos: number): string => {
6666
// #region Exports
6767
// -----------------------------------------------------------------------------------------
6868

69-
const StringUtils = {
69+
export const StringUtils = {
7070
camelCase: _.camelCase,
7171
capitalize: _.capitalize,
7272
filename,
@@ -86,6 +86,4 @@ const StringUtils = {
8686
words: _.words,
8787
};
8888

89-
export default StringUtils;
90-
9189
// #endregion Exports

0 commit comments

Comments
 (0)