b2m-utils 0.0.131 → 0.0.133

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.
@@ -0,0 +1 @@
1
+ export declare const convertNumberToCurrency: (value: number, locale?: string) => string;
@@ -0,0 +1 @@
1
+ export declare const getNormalizedCityName: (name: string) => string;
@@ -1,3 +1,5 @@
1
+ export * from './convertNumberToCurrency';
2
+ export * from './getNormalizedCityName';
1
3
  export * from './getContractFromFreight';
2
4
  export * from './getContractRouteFromFreight';
3
5
  export * from './getRouteDeliveryTimeFromFreight';
@@ -1,3 +1,25 @@
1
+ var convertNumberToCurrency = function (value, locale) {
2
+ if (locale === void 0) { locale = 'en-US'; }
3
+ var configObject = {
4
+ locale: 'en-US',
5
+ currency: 'USD',
6
+ };
7
+ switch (locale) {
8
+ case 'pt-br':
9
+ configObject.locale = 'pt-br';
10
+ configObject.currency = 'BRL';
11
+ break;
12
+ }
13
+ return (+value).toLocaleString(configObject.locale, {
14
+ style: 'currency',
15
+ currency: configObject.currency,
16
+ });
17
+ };
18
+
19
+ var getNormalizedCityName = function (name) {
20
+ return name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
21
+ };
22
+
1
23
  /**
2
24
  * @name toDate
3
25
  * @category Common Helpers
@@ -6458,5 +6480,5 @@ var setFormattedDatesInObjects = function (objectFormat) { return __awaiter(void
6458
6480
  });
6459
6481
  }); };
6460
6482
 
6461
- export { ApplicationColumnNameEnum, ApplicationEnum, CountryEnum, CurrencyEnum, DocumentTypeEnum, DomainConfigurationEnum, DomainTypeEnum, FeeCalculationTypeEnum, FeeCategoryEnum, FreightRegionEnum, ModalEnum, NotificationTypeEnum, PermissionEnum, SlaRegionEnum, SpotStatusEnum, TrackProcessProviderTypeEnum, formatDateString, getConfigurationFromDomain, getContractFromFreight, getContractRouteFromFreight, getCookies, getDataFromToken, getFormattedFreightPlaceName, getRouteDeliveryTimeFromFreight, getRouteOnTimeFromFreight, setFormattedDatesInObjects };
6483
+ export { ApplicationColumnNameEnum, ApplicationEnum, CountryEnum, CurrencyEnum, DocumentTypeEnum, DomainConfigurationEnum, DomainTypeEnum, FeeCalculationTypeEnum, FeeCategoryEnum, FreightRegionEnum, ModalEnum, NotificationTypeEnum, PermissionEnum, SlaRegionEnum, SpotStatusEnum, TrackProcessProviderTypeEnum, convertNumberToCurrency, formatDateString, getConfigurationFromDomain, getContractFromFreight, getContractRouteFromFreight, getCookies, getDataFromToken, getFormattedFreightPlaceName, getNormalizedCityName, getRouteDeliveryTimeFromFreight, getRouteOnTimeFromFreight, setFormattedDatesInObjects };
6462
6484
  //# sourceMappingURL=index.esm.js.map
Binary file