@stndrds/constants 1.0.0-alpha.78 → 1.0.0-alpha.80
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/dist/index.d.mts +26 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +46 -0
- package/dist/index.mjs +43 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1009,6 +1009,31 @@ declare const isValidIso2: (code: string) => code is CountryIso2;
|
|
|
1009
1009
|
* Type guard to check if a string is a valid ISO3 country code
|
|
1010
1010
|
*/
|
|
1011
1011
|
declare const isValidIso3: (code: string) => code is CountryIso3;
|
|
1012
|
+
/**
|
|
1013
|
+
* Get the display name of a country in the specified locale.
|
|
1014
|
+
* Defaults to French with English as fallback.
|
|
1015
|
+
* Uses Intl.DisplayNames for locale-aware names (e.g., "Italie" for "IT" in French).
|
|
1016
|
+
* The Intl.DisplayNames instance is cached at module level to avoid repeated allocations.
|
|
1017
|
+
*
|
|
1018
|
+
* @param iso2 - ISO 3166-1 alpha-2 country code (e.g., "FR", "IT")
|
|
1019
|
+
* @param locales - BCP 47 language tags in preference order (default: ['fr', 'en'])
|
|
1020
|
+
*/
|
|
1021
|
+
declare function getCountryDisplayName(iso2: string, locales?: string | string[]): string;
|
|
1022
|
+
/**
|
|
1023
|
+
* Get the display name of a country by its ISO 3166-1 alpha-3 code.
|
|
1024
|
+
* Defaults to French with English as fallback.
|
|
1025
|
+
*
|
|
1026
|
+
* @param iso3 - ISO 3166-1 alpha-3 country code (e.g., "FRA", "ITA")
|
|
1027
|
+
* @param locales - BCP 47 language tags in preference order (default: ['fr', 'en'])
|
|
1028
|
+
*/
|
|
1029
|
+
declare function getCountryDisplayNameByIso3(iso3: string, locales?: string | string[]): string;
|
|
1030
|
+
/**
|
|
1031
|
+
* Get all countries sorted alphabetically by their display name in the given locale.
|
|
1032
|
+
* Sorted once — callers should store the result in a module-level constant.
|
|
1033
|
+
*
|
|
1034
|
+
* @param locale - BCP 47 language tag for sorting (default: 'fr')
|
|
1035
|
+
*/
|
|
1036
|
+
declare function getSortedCountries(locale?: string): Country[];
|
|
1012
1037
|
/**
|
|
1013
1038
|
* Strip the national trunk prefix from a phone number.
|
|
1014
1039
|
* Pure string operation, no external dependencies.
|
|
@@ -1802,4 +1827,4 @@ declare const isCodeMimeType: (mimeType: string) => boolean;
|
|
|
1802
1827
|
*/
|
|
1803
1828
|
declare const getExtensionFromMimeType: (mimeType: string) => string | null;
|
|
1804
1829
|
|
|
1805
|
-
export { AI_CHAT_ACCEPTED_TYPES, AI_CHAT_MAX_FILES, AI_CHAT_MAX_FILE_SIZE, AI_CHAT_SUPPORTED_DOCUMENTS, AI_CHAT_SUPPORTED_IMAGES, AI_CHAT_SUPPORTED_MIME_TYPES, ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, type MimeType, OFFICE_DOCUMENTS, OTHER_MIME_TYPES, RECOMMENDED_MAX_SIZES, STATUS_COLORS, type StatusColorGroup, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, formatBytes, gbToBytes, getAllColors, getAllCountries, getAllCurrencies, getColor, getColorIds, getColorsByGroup, getCountryByIso2, getCountryByIso3, getCountryPhoneCode, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getExtensionFromMimeType, getPhoneMaxDigits, getPhoneTrunkPrefix, isAIChatSupportedMimeType, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes, stripTrunkPrefix };
|
|
1830
|
+
export { AI_CHAT_ACCEPTED_TYPES, AI_CHAT_MAX_FILES, AI_CHAT_MAX_FILE_SIZE, AI_CHAT_SUPPORTED_DOCUMENTS, AI_CHAT_SUPPORTED_IMAGES, AI_CHAT_SUPPORTED_MIME_TYPES, ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, type MimeType, OFFICE_DOCUMENTS, OTHER_MIME_TYPES, RECOMMENDED_MAX_SIZES, STATUS_COLORS, type StatusColorGroup, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, formatBytes, gbToBytes, getAllColors, getAllCountries, getAllCurrencies, getColor, getColorIds, getColorsByGroup, getCountryByIso2, getCountryByIso3, getCountryDisplayName, getCountryDisplayNameByIso3, getCountryPhoneCode, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getExtensionFromMimeType, getPhoneMaxDigits, getPhoneTrunkPrefix, getSortedCountries, isAIChatSupportedMimeType, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes, stripTrunkPrefix };
|
package/dist/index.d.ts
CHANGED
|
@@ -1009,6 +1009,31 @@ declare const isValidIso2: (code: string) => code is CountryIso2;
|
|
|
1009
1009
|
* Type guard to check if a string is a valid ISO3 country code
|
|
1010
1010
|
*/
|
|
1011
1011
|
declare const isValidIso3: (code: string) => code is CountryIso3;
|
|
1012
|
+
/**
|
|
1013
|
+
* Get the display name of a country in the specified locale.
|
|
1014
|
+
* Defaults to French with English as fallback.
|
|
1015
|
+
* Uses Intl.DisplayNames for locale-aware names (e.g., "Italie" for "IT" in French).
|
|
1016
|
+
* The Intl.DisplayNames instance is cached at module level to avoid repeated allocations.
|
|
1017
|
+
*
|
|
1018
|
+
* @param iso2 - ISO 3166-1 alpha-2 country code (e.g., "FR", "IT")
|
|
1019
|
+
* @param locales - BCP 47 language tags in preference order (default: ['fr', 'en'])
|
|
1020
|
+
*/
|
|
1021
|
+
declare function getCountryDisplayName(iso2: string, locales?: string | string[]): string;
|
|
1022
|
+
/**
|
|
1023
|
+
* Get the display name of a country by its ISO 3166-1 alpha-3 code.
|
|
1024
|
+
* Defaults to French with English as fallback.
|
|
1025
|
+
*
|
|
1026
|
+
* @param iso3 - ISO 3166-1 alpha-3 country code (e.g., "FRA", "ITA")
|
|
1027
|
+
* @param locales - BCP 47 language tags in preference order (default: ['fr', 'en'])
|
|
1028
|
+
*/
|
|
1029
|
+
declare function getCountryDisplayNameByIso3(iso3: string, locales?: string | string[]): string;
|
|
1030
|
+
/**
|
|
1031
|
+
* Get all countries sorted alphabetically by their display name in the given locale.
|
|
1032
|
+
* Sorted once — callers should store the result in a module-level constant.
|
|
1033
|
+
*
|
|
1034
|
+
* @param locale - BCP 47 language tag for sorting (default: 'fr')
|
|
1035
|
+
*/
|
|
1036
|
+
declare function getSortedCountries(locale?: string): Country[];
|
|
1012
1037
|
/**
|
|
1013
1038
|
* Strip the national trunk prefix from a phone number.
|
|
1014
1039
|
* Pure string operation, no external dependencies.
|
|
@@ -1802,4 +1827,4 @@ declare const isCodeMimeType: (mimeType: string) => boolean;
|
|
|
1802
1827
|
*/
|
|
1803
1828
|
declare const getExtensionFromMimeType: (mimeType: string) => string | null;
|
|
1804
1829
|
|
|
1805
|
-
export { AI_CHAT_ACCEPTED_TYPES, AI_CHAT_MAX_FILES, AI_CHAT_MAX_FILE_SIZE, AI_CHAT_SUPPORTED_DOCUMENTS, AI_CHAT_SUPPORTED_IMAGES, AI_CHAT_SUPPORTED_MIME_TYPES, ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, type MimeType, OFFICE_DOCUMENTS, OTHER_MIME_TYPES, RECOMMENDED_MAX_SIZES, STATUS_COLORS, type StatusColorGroup, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, formatBytes, gbToBytes, getAllColors, getAllCountries, getAllCurrencies, getColor, getColorIds, getColorsByGroup, getCountryByIso2, getCountryByIso3, getCountryPhoneCode, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getExtensionFromMimeType, getPhoneMaxDigits, getPhoneTrunkPrefix, isAIChatSupportedMimeType, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes, stripTrunkPrefix };
|
|
1830
|
+
export { AI_CHAT_ACCEPTED_TYPES, AI_CHAT_MAX_FILES, AI_CHAT_MAX_FILE_SIZE, AI_CHAT_SUPPORTED_DOCUMENTS, AI_CHAT_SUPPORTED_IMAGES, AI_CHAT_SUPPORTED_MIME_TYPES, ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, type MimeType, OFFICE_DOCUMENTS, OTHER_MIME_TYPES, RECOMMENDED_MAX_SIZES, STATUS_COLORS, type StatusColorGroup, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, formatBytes, gbToBytes, getAllColors, getAllCountries, getAllCurrencies, getColor, getColorIds, getColorsByGroup, getCountryByIso2, getCountryByIso3, getCountryDisplayName, getCountryDisplayNameByIso3, getCountryPhoneCode, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getExtensionFromMimeType, getPhoneMaxDigits, getPhoneTrunkPrefix, getSortedCountries, isAIChatSupportedMimeType, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes, stripTrunkPrefix };
|
package/dist/index.js
CHANGED
|
@@ -77,6 +77,8 @@ __export(index_exports, {
|
|
|
77
77
|
getColorsByGroup: () => getColorsByGroup,
|
|
78
78
|
getCountryByIso2: () => getCountryByIso2,
|
|
79
79
|
getCountryByIso3: () => getCountryByIso3,
|
|
80
|
+
getCountryDisplayName: () => getCountryDisplayName,
|
|
81
|
+
getCountryDisplayNameByIso3: () => getCountryDisplayNameByIso3,
|
|
80
82
|
getCountryPhoneCode: () => getCountryPhoneCode,
|
|
81
83
|
getCurrency: () => getCurrency,
|
|
82
84
|
getCurrencySymbol: () => getCurrencySymbol,
|
|
@@ -84,6 +86,7 @@ __export(index_exports, {
|
|
|
84
86
|
getExtensionFromMimeType: () => getExtensionFromMimeType,
|
|
85
87
|
getPhoneMaxDigits: () => getPhoneMaxDigits,
|
|
86
88
|
getPhoneTrunkPrefix: () => getPhoneTrunkPrefix,
|
|
89
|
+
getSortedCountries: () => getSortedCountries,
|
|
87
90
|
isAIChatSupportedMimeType: () => isAIChatSupportedMimeType,
|
|
88
91
|
isArchiveMimeType: () => isArchiveMimeType,
|
|
89
92
|
isAudioMimeType: () => isAudioMimeType,
|
|
@@ -1277,6 +1280,46 @@ var isValidIso3 = (code) => {
|
|
|
1277
1280
|
(country) => country.iso3.toUpperCase() === code.toUpperCase()
|
|
1278
1281
|
);
|
|
1279
1282
|
};
|
|
1283
|
+
var _displayNamesCache = /* @__PURE__ */ new Map();
|
|
1284
|
+
function _getDisplayNames(locales) {
|
|
1285
|
+
const key = locales.join("\0");
|
|
1286
|
+
const cached = _displayNamesCache.get(key);
|
|
1287
|
+
if (cached !== void 0) return cached;
|
|
1288
|
+
try {
|
|
1289
|
+
const dn = new Intl.DisplayNames(locales, { type: "region" });
|
|
1290
|
+
_displayNamesCache.set(key, dn);
|
|
1291
|
+
return dn;
|
|
1292
|
+
} catch {
|
|
1293
|
+
_displayNamesCache.set(key, null);
|
|
1294
|
+
return null;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
function getCountryDisplayName(iso2, locales = ["fr", "en"]) {
|
|
1298
|
+
const code = iso2.toUpperCase();
|
|
1299
|
+
const localeList = Array.isArray(locales) ? locales : [locales];
|
|
1300
|
+
const displayNames = _getDisplayNames(localeList);
|
|
1301
|
+
if (displayNames) {
|
|
1302
|
+
try {
|
|
1303
|
+
const name = displayNames.of(code);
|
|
1304
|
+
if (name) return name;
|
|
1305
|
+
} catch {
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
return COUNTRIES[code]?.name ?? code;
|
|
1309
|
+
}
|
|
1310
|
+
function getCountryDisplayNameByIso3(iso3, locales) {
|
|
1311
|
+
const country = getCountryByIso3(iso3);
|
|
1312
|
+
if (!country) return iso3;
|
|
1313
|
+
return getCountryDisplayName(country.iso2, locales);
|
|
1314
|
+
}
|
|
1315
|
+
function getSortedCountries(locale = "fr") {
|
|
1316
|
+
return getAllCountries().sort(
|
|
1317
|
+
(a, b) => getCountryDisplayName(a.iso2, locale).localeCompare(
|
|
1318
|
+
getCountryDisplayName(b.iso2, locale),
|
|
1319
|
+
locale
|
|
1320
|
+
)
|
|
1321
|
+
);
|
|
1322
|
+
}
|
|
1280
1323
|
function stripTrunkPrefix(phoneNumber, trunkPrefix) {
|
|
1281
1324
|
if (!trunkPrefix) return phoneNumber;
|
|
1282
1325
|
return phoneNumber.startsWith(trunkPrefix) ? phoneNumber.slice(trunkPrefix.length) : phoneNumber;
|
|
@@ -2802,6 +2845,8 @@ var ICONS = [
|
|
|
2802
2845
|
getColorsByGroup,
|
|
2803
2846
|
getCountryByIso2,
|
|
2804
2847
|
getCountryByIso3,
|
|
2848
|
+
getCountryDisplayName,
|
|
2849
|
+
getCountryDisplayNameByIso3,
|
|
2805
2850
|
getCountryPhoneCode,
|
|
2806
2851
|
getCurrency,
|
|
2807
2852
|
getCurrencySymbol,
|
|
@@ -2809,6 +2854,7 @@ var ICONS = [
|
|
|
2809
2854
|
getExtensionFromMimeType,
|
|
2810
2855
|
getPhoneMaxDigits,
|
|
2811
2856
|
getPhoneTrunkPrefix,
|
|
2857
|
+
getSortedCountries,
|
|
2812
2858
|
isAIChatSupportedMimeType,
|
|
2813
2859
|
isArchiveMimeType,
|
|
2814
2860
|
isAudioMimeType,
|
package/dist/index.mjs
CHANGED
|
@@ -1174,6 +1174,46 @@ var isValidIso3 = (code) => {
|
|
|
1174
1174
|
(country) => country.iso3.toUpperCase() === code.toUpperCase()
|
|
1175
1175
|
);
|
|
1176
1176
|
};
|
|
1177
|
+
var _displayNamesCache = /* @__PURE__ */ new Map();
|
|
1178
|
+
function _getDisplayNames(locales) {
|
|
1179
|
+
const key = locales.join("\0");
|
|
1180
|
+
const cached = _displayNamesCache.get(key);
|
|
1181
|
+
if (cached !== void 0) return cached;
|
|
1182
|
+
try {
|
|
1183
|
+
const dn = new Intl.DisplayNames(locales, { type: "region" });
|
|
1184
|
+
_displayNamesCache.set(key, dn);
|
|
1185
|
+
return dn;
|
|
1186
|
+
} catch {
|
|
1187
|
+
_displayNamesCache.set(key, null);
|
|
1188
|
+
return null;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
function getCountryDisplayName(iso2, locales = ["fr", "en"]) {
|
|
1192
|
+
const code = iso2.toUpperCase();
|
|
1193
|
+
const localeList = Array.isArray(locales) ? locales : [locales];
|
|
1194
|
+
const displayNames = _getDisplayNames(localeList);
|
|
1195
|
+
if (displayNames) {
|
|
1196
|
+
try {
|
|
1197
|
+
const name = displayNames.of(code);
|
|
1198
|
+
if (name) return name;
|
|
1199
|
+
} catch {
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
return COUNTRIES[code]?.name ?? code;
|
|
1203
|
+
}
|
|
1204
|
+
function getCountryDisplayNameByIso3(iso3, locales) {
|
|
1205
|
+
const country = getCountryByIso3(iso3);
|
|
1206
|
+
if (!country) return iso3;
|
|
1207
|
+
return getCountryDisplayName(country.iso2, locales);
|
|
1208
|
+
}
|
|
1209
|
+
function getSortedCountries(locale = "fr") {
|
|
1210
|
+
return getAllCountries().sort(
|
|
1211
|
+
(a, b) => getCountryDisplayName(a.iso2, locale).localeCompare(
|
|
1212
|
+
getCountryDisplayName(b.iso2, locale),
|
|
1213
|
+
locale
|
|
1214
|
+
)
|
|
1215
|
+
);
|
|
1216
|
+
}
|
|
1177
1217
|
function stripTrunkPrefix(phoneNumber, trunkPrefix) {
|
|
1178
1218
|
if (!trunkPrefix) return phoneNumber;
|
|
1179
1219
|
return phoneNumber.startsWith(trunkPrefix) ? phoneNumber.slice(trunkPrefix.length) : phoneNumber;
|
|
@@ -2698,6 +2738,8 @@ export {
|
|
|
2698
2738
|
getColorsByGroup,
|
|
2699
2739
|
getCountryByIso2,
|
|
2700
2740
|
getCountryByIso3,
|
|
2741
|
+
getCountryDisplayName,
|
|
2742
|
+
getCountryDisplayNameByIso3,
|
|
2701
2743
|
getCountryPhoneCode,
|
|
2702
2744
|
getCurrency,
|
|
2703
2745
|
getCurrencySymbol,
|
|
@@ -2705,6 +2747,7 @@ export {
|
|
|
2705
2747
|
getExtensionFromMimeType,
|
|
2706
2748
|
getPhoneMaxDigits,
|
|
2707
2749
|
getPhoneTrunkPrefix,
|
|
2750
|
+
getSortedCountries,
|
|
2708
2751
|
isAIChatSupportedMimeType,
|
|
2709
2752
|
isArchiveMimeType,
|
|
2710
2753
|
isAudioMimeType,
|