b2m-utils 0.0.147 → 0.0.149

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.
@@ -4,9 +4,12 @@ export declare enum FeeEnum {
4
4
  RIVER_REDISPATCH_COMMODITY_VALUE = 86,
5
5
  SUFRAMA = 90,
6
6
  TDE_FREIGHT = 91,
7
+ TDE_MIN = 92,
7
8
  TRT_FREIGHT = 93,
9
+ TRT_MIN = 93,
8
10
  ICMS = 95,
9
11
  SCHEDULING_TAX = 108,
10
12
  COLLECT_COMMODITY_VALUE = 136,
13
+ TDA_MIN = 141,
11
14
  TDA_FREIGHT = 142
12
15
  }
@@ -1 +1 @@
1
- export declare const convertNumberToCurrency: (value: number, locale?: string) => string;
1
+ export declare const convertNumberToCurrency: (value: number, locale?: string, options?: Intl.NumberFormatOptions) => string;
@@ -1,4 +1,73 @@
1
- var convertNumberToCurrency = function (value, locale) {
1
+ /******************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
15
+
16
+ var __assign = function() {
17
+ __assign = Object.assign || function __assign(t) {
18
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
19
+ s = arguments[i];
20
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
21
+ }
22
+ return t;
23
+ };
24
+ return __assign.apply(this, arguments);
25
+ };
26
+
27
+ function __awaiter(thisArg, _arguments, P, generator) {
28
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
29
+ return new (P || (P = Promise))(function (resolve, reject) {
30
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
31
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
32
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
33
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
34
+ });
35
+ }
36
+
37
+ function __generator(thisArg, body) {
38
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
+ function verb(n) { return function (v) { return step([n, v]); }; }
41
+ function step(op) {
42
+ if (f) throw new TypeError("Generator is already executing.");
43
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
44
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
+ if (y = 0, t) op = [op[0] & 2, t.value];
46
+ switch (op[0]) {
47
+ case 0: case 1: t = op; break;
48
+ case 4: _.label++; return { value: op[1], done: false };
49
+ case 5: _.label++; y = op[1]; op = [0]; continue;
50
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
51
+ default:
52
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
53
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
55
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
56
+ if (t[2]) _.ops.pop();
57
+ _.trys.pop(); continue;
58
+ }
59
+ op = body.call(thisArg, _);
60
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
61
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
+ }
63
+ }
64
+
65
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
66
+ var e = new Error(message);
67
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
68
+ };
69
+
70
+ var convertNumberToCurrency = function (value, locale, options) {
2
71
  if (locale === void 0) { locale = 'en-US'; }
3
72
  var configObject = {
4
73
  locale: 'en-US',
@@ -10,10 +79,7 @@ var convertNumberToCurrency = function (value, locale) {
10
79
  configObject.currency = 'BRL';
11
80
  break;
12
81
  }
13
- return (+value).toLocaleString(configObject.locale, {
14
- style: 'currency',
15
- currency: configObject.currency,
16
- });
82
+ return (+value).toLocaleString(configObject.locale, __assign({ style: 'currency', currency: configObject.currency }, options));
17
83
  };
18
84
 
19
85
  var getNormalizedCityName = function (name) {
@@ -6308,10 +6374,13 @@ var FeeEnum;
6308
6374
  FeeEnum[FeeEnum["RIVER_REDISPATCH_COMMODITY_VALUE"] = 86] = "RIVER_REDISPATCH_COMMODITY_VALUE";
6309
6375
  FeeEnum[FeeEnum["SUFRAMA"] = 90] = "SUFRAMA";
6310
6376
  FeeEnum[FeeEnum["TDE_FREIGHT"] = 91] = "TDE_FREIGHT";
6377
+ FeeEnum[FeeEnum["TDE_MIN"] = 92] = "TDE_MIN";
6311
6378
  FeeEnum[FeeEnum["TRT_FREIGHT"] = 93] = "TRT_FREIGHT";
6379
+ FeeEnum[FeeEnum["TRT_MIN"] = 93] = "TRT_MIN";
6312
6380
  FeeEnum[FeeEnum["ICMS"] = 95] = "ICMS";
6313
6381
  FeeEnum[FeeEnum["SCHEDULING_TAX"] = 108] = "SCHEDULING_TAX";
6314
6382
  FeeEnum[FeeEnum["COLLECT_COMMODITY_VALUE"] = 136] = "COLLECT_COMMODITY_VALUE";
6383
+ FeeEnum[FeeEnum["TDA_MIN"] = 141] = "TDA_MIN";
6315
6384
  FeeEnum[FeeEnum["TDA_FREIGHT"] = 142] = "TDA_FREIGHT";
6316
6385
  })(FeeEnum || (FeeEnum = {}));
6317
6386
 
@@ -6409,64 +6478,6 @@ var getFormattedFreightPlaceName = function (freightPlace, modalId, complete, sq
6409
6478
  }
6410
6479
  };
6411
6480
 
6412
- /******************************************************************************
6413
- Copyright (c) Microsoft Corporation.
6414
-
6415
- Permission to use, copy, modify, and/or distribute this software for any
6416
- purpose with or without fee is hereby granted.
6417
-
6418
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
6419
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
6420
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
6421
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
6422
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
6423
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
6424
- PERFORMANCE OF THIS SOFTWARE.
6425
- ***************************************************************************** */
6426
-
6427
- function __awaiter(thisArg, _arguments, P, generator) {
6428
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6429
- return new (P || (P = Promise))(function (resolve, reject) {
6430
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6431
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6432
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
6433
- step((generator = generator.apply(thisArg, _arguments || [])).next());
6434
- });
6435
- }
6436
-
6437
- function __generator(thisArg, body) {
6438
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
6439
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
6440
- function verb(n) { return function (v) { return step([n, v]); }; }
6441
- function step(op) {
6442
- if (f) throw new TypeError("Generator is already executing.");
6443
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
6444
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
6445
- if (y = 0, t) op = [op[0] & 2, t.value];
6446
- switch (op[0]) {
6447
- case 0: case 1: t = op; break;
6448
- case 4: _.label++; return { value: op[1], done: false };
6449
- case 5: _.label++; y = op[1]; op = [0]; continue;
6450
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
6451
- default:
6452
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
6453
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
6454
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
6455
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
6456
- if (t[2]) _.ops.pop();
6457
- _.trys.pop(); continue;
6458
- }
6459
- op = body.call(thisArg, _);
6460
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
6461
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
6462
- }
6463
- }
6464
-
6465
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
6466
- var e = new Error(message);
6467
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
6468
- };
6469
-
6470
6481
  var setFormattedDatesInObjects = function (objectFormat) { return __awaiter(void 0, void 0, void 0, function () {
6471
6482
  var _a, _b, _c, _i, key, formattedDate, _d, _e, _f, _g;
6472
6483
  return __generator(this, function (_h) {
Binary file