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.
package/build/index.js CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var convertNumberToCurrency = function (value, locale) {
6
+ if (locale === void 0) { locale = 'en-US'; }
7
+ var configObject = {
8
+ locale: 'en-US',
9
+ currency: 'USD',
10
+ };
11
+ switch (locale) {
12
+ case 'pt-br':
13
+ configObject.locale = 'pt-br';
14
+ configObject.currency = 'BRL';
15
+ break;
16
+ }
17
+ return (+value).toLocaleString(configObject.locale, {
18
+ style: 'currency',
19
+ currency: configObject.currency,
20
+ });
21
+ };
22
+
23
+ var getNormalizedCityName = function (name) {
24
+ return name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
25
+ };
26
+
5
27
  /**
6
28
  * @name toDate
7
29
  * @category Common Helpers
@@ -6462,6 +6484,7 @@ var setFormattedDatesInObjects = function (objectFormat) { return __awaiter(void
6462
6484
  });
6463
6485
  }); };
6464
6486
 
6487
+ exports.convertNumberToCurrency = convertNumberToCurrency;
6465
6488
  exports.formatDateString = formatDateString;
6466
6489
  exports.getConfigurationFromDomain = getConfigurationFromDomain;
6467
6490
  exports.getContractFromFreight = getContractFromFreight;
@@ -6469,6 +6492,7 @@ exports.getContractRouteFromFreight = getContractRouteFromFreight;
6469
6492
  exports.getCookies = getCookies;
6470
6493
  exports.getDataFromToken = getDataFromToken;
6471
6494
  exports.getFormattedFreightPlaceName = getFormattedFreightPlaceName;
6495
+ exports.getNormalizedCityName = getNormalizedCityName;
6472
6496
  exports.getRouteDeliveryTimeFromFreight = getRouteDeliveryTimeFromFreight;
6473
6497
  exports.getRouteOnTimeFromFreight = getRouteOnTimeFromFreight;
6474
6498
  exports.setFormattedDatesInObjects = setFormattedDatesInObjects;
package/build/index.js.gz CHANGED
Binary file