@fileverse-dev/formulajs 4.4.11-mod-64-patch-2 → 4.4.11-mod-67

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.
@@ -1,4 +1,4 @@
1
- /* @fileverse-dev/formulajs v4.4.11-mod-64-patch-2 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-67 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -7656,6 +7656,21 @@ function _typeof(o) {
7656
7656
  }));
7657
7657
  return result;
7658
7658
  }
7659
+ function MINUS$1() {
7660
+ var args = argsToArray(arguments);
7661
+ if (args.length !== 2) {
7662
+ return value;
7663
+ }
7664
+ var num1 = args[0];
7665
+ var num2 = args[1];
7666
+ if (num1 instanceof Error || num2 instanceof Error) {
7667
+ return num1 instanceof Error ? num1 : num2;
7668
+ }
7669
+ if (typeof num1 !== "number" || typeof num2 !== "number") {
7670
+ return value;
7671
+ }
7672
+ return num1 - num2;
7673
+ }
7659
7674
  function SUMIF(range, criteria, sum_range) {
7660
7675
  range = flatten(range);
7661
7676
  sum_range = sum_range ? flatten(sum_range) : range;
@@ -11066,8 +11081,9 @@ function _typeof(o) {
11066
11081
  if (!functionName) {
11067
11082
  var _Error$stack;
11068
11083
  var stack = (_Error$stack = (new Error).stack) === null || _Error$stack === void 0 ? void 0 : _Error$stack.split("\n")[2];
11069
- var match = stack === null || stack === void 0 ? void 0 : stack.match(/at (\w+)/);
11070
- functionName = match === null || match === void 0 ? void 0 : match[1];
11084
+ var match = stack === null || stack === void 0 ? void 0 : stack.match(/at (.+?) \(/);
11085
+ var rawFnName = match === null || match === void 0 ? void 0 : match[1];
11086
+ functionName = (rawFnName === null || rawFnName === void 0 ? void 0 : rawFnName.split(".").pop()) || "[unable to detect function name]";
11071
11087
  }
11072
11088
  switch (errorFlag) {
11073
11089
  case ERROR_MESSAGES_FLAG.INVALID_ADDRESS:
@@ -11173,10 +11189,9 @@ function _typeof(o) {
11173
11189
  if (!inputMap[key]) {
11174
11190
  var _Error$stack2;
11175
11191
  var stack = (_Error$stack2 = (new Error).stack) === null || _Error$stack2 === void 0 ? void 0 : _Error$stack2.split("\n")[2];
11176
- console.log("STACK LINE:", stack);
11177
11192
  var match = stack === null || stack === void 0 ? void 0 : stack.match(/at (.+?) \(/);
11178
11193
  var rawFnName = match === null || match === void 0 ? void 0 : match[1];
11179
- var parentFunctionName = (rawFnName === null || rawFnName === void 0 ? void 0 : rawFnName.split(".").pop()) || "anonymous";
11194
+ var parentFunctionName = (rawFnName === null || rawFnName === void 0 ? void 0 : rawFnName.split(".").pop()) || "[unable to detect function name]";
11180
11195
  var paramName = key;
11181
11196
  return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_PARAM, paramName, parentFunctionName);
11182
11197
  }
@@ -12196,6 +12211,7 @@ function _typeof(o) {
12196
12211
  }
12197
12212
  function _COINGECKO() {
12198
12213
  _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11() {
12214
+ var _toLowerCase, _ref5;
12199
12215
  var _argsToArray15, _argsToArray16, category, param1, param2, missingParamsError, API_KEY, headers, url, lowerCategory, token, vsCurrencies, ecosystemMap, key, categoryVal, trend, _category, _trend, exchange, response, json, _json$status, message, output, _i14, _Object$entries5, _Object$entries5$_i, _token, prices, _i15, _Object$entries6, _Object$entries6$_i, currency, _value0, _key3, _data, exchangeDetails, flatArray, _args11 = arguments;
12200
12216
  return _regeneratorRuntime().wrap((function _callee11$(_context11) {
12201
12217
  while (1) switch (_context11.prev = _context11.next) {
@@ -12226,7 +12242,7 @@ function _typeof(o) {
12226
12242
  "x-cg-demo-api-key": API_KEY
12227
12243
  };
12228
12244
  url = "";
12229
- lowerCategory = (category || "").toLowerCase();
12245
+ lowerCategory = (_toLowerCase = (_ref5 = category || "").toLowerCase) === null || _toLowerCase === void 0 ? void 0 : _toLowerCase.call(_ref5);
12230
12246
  _context11.t0 = lowerCategory;
12231
12247
  _context11.next = _context11.t0 === "price" ? 13 : _context11.t0 === "market" ? 19 : _context11.t0 === "stablecoins" ? 27 : _context11.t0 === "derivatives" ? 31 : 34;
12232
12248
  break;
@@ -12393,7 +12409,7 @@ function _typeof(o) {
12393
12409
  while (1) switch (_context16.prev = _context16.next) {
12394
12410
  case 0:
12395
12411
  _fetchJSON = function _fetchJSON3() {
12396
- _fetchJSON = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12(url) {
12412
+ _fetchJSON = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12(url, fnName) {
12397
12413
  var _json$result3, _json$result3$include, _json$result4, _json$result4$include, res, json;
12398
12414
  return _regeneratorRuntime().wrap((function _callee12$(_context15) {
12399
12415
  while (1) switch (_context15.prev = _context15.next) {
@@ -12408,7 +12424,7 @@ function _typeof(o) {
12408
12424
  _context15.next = 6;
12409
12425
  break;
12410
12426
  }
12411
- return _context15.abrupt("return", errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status));
12427
+ return _context15.abrupt("return", errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status, fnName));
12412
12428
 
12413
12429
  case 6:
12414
12430
  _context15.next = 8;
@@ -12420,14 +12436,14 @@ function _typeof(o) {
12420
12436
  _context15.next = 11;
12421
12437
  break;
12422
12438
  }
12423
- return _context15.abrupt("return", errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_API_KEY, SERVICES_API_KEY.Etherscan));
12439
+ return _context15.abrupt("return", errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_API_KEY, SERVICES_API_KEY.Etherscan, fnName));
12424
12440
 
12425
12441
  case 11:
12426
12442
  if (!((_json$result4 = json.result) !== null && _json$result4 !== void 0 && (_json$result4$include = _json$result4.includes) !== null && _json$result4$include !== void 0 && _json$result4$include.call(_json$result4, "Max rate limit reached"))) {
12427
12443
  _context15.next = 13;
12428
12444
  break;
12429
12445
  }
12430
- return _context15.abrupt("return", errorMessageHandler(ERROR_MESSAGES_FLAG.RATE_LIMIT, SERVICES_API_KEY.Etherscan));
12446
+ return _context15.abrupt("return", errorMessageHandler(ERROR_MESSAGES_FLAG.RATE_LIMIT, SERVICES_API_KEY.Etherscan, fnName));
12431
12447
 
12432
12448
  case 13:
12433
12449
  if (!(json.status === "0" && json.message !== "No transactions found")) {
@@ -12435,9 +12451,9 @@ function _typeof(o) {
12435
12451
  break;
12436
12452
  }
12437
12453
  return _context15.abrupt("return", errorMessageHandler(ERROR_MESSAGES_FLAG.CUSTOM, {
12438
- message: json.message || "Api Error",
12439
- reason: json.message || 'json.status === "0" && json.message !== "No transactions found"'
12440
- }));
12454
+ message: "Api Error",
12455
+ reason: (json === null || json === void 0 ? void 0 : json.result) || 'json.status === "0" && json.message !== "No transactions found"'
12456
+ }, fnName));
12441
12457
 
12442
12458
  case 15:
12443
12459
  return _context15.abrupt("return", json.result);
@@ -12445,7 +12461,7 @@ function _typeof(o) {
12445
12461
  case 18:
12446
12462
  _context15.prev = 18;
12447
12463
  _context15.t0 = _context15["catch"](0);
12448
- return _context15.abrupt("return", errorMessageHandler(ERROR_MESSAGES_FLAG.DEFAULT, _context15.t0));
12464
+ return _context15.abrupt("return", errorMessageHandler(ERROR_MESSAGES_FLAG.DEFAULT, _context15.t0, fnName));
12449
12465
 
12450
12466
  case 21:
12451
12467
  case "end":
@@ -12455,7 +12471,7 @@ function _typeof(o) {
12455
12471
  })));
12456
12472
  return _fetchJSON.apply(this, arguments);
12457
12473
  };
12458
- fetchJSON = function _fetchJSON2(_x0) {
12474
+ fetchJSON = function _fetchJSON2(_x0, _x1) {
12459
12475
  return _fetchJSON.apply(this, arguments);
12460
12476
  };
12461
12477
  _argsToArray17 = argsToArray(_args16), _argsToArray18 = _slicedToArray(_argsToArray17, 7),
@@ -12589,7 +12605,7 @@ function _typeof(o) {
12589
12605
  action = "addresstokenbalance";
12590
12606
  url = "https://api.etherscan.io/v2/api?chainid=".concat(chainId) + "&module=account&action=".concat(action, "&address=").concat(slice) + "&page=".concat(page, "&offset=100&apikey=").concat(API_KEY);
12591
12607
  _context12.next = 5;
12592
- return fetchJSON(url);
12608
+ return fetchJSON(url, "EOA");
12593
12609
 
12594
12610
  case 5:
12595
12611
  data = _context12.sent;
@@ -12688,7 +12704,7 @@ function _typeof(o) {
12688
12704
  addr = _ADDRS[_i17];
12689
12705
  url = "https://api.etherscan.io/v2/api?chainid=".concat(chainId) + "&module=account&action=tokentx&address=".concat(addr) + "&startblock=".concat(startBlock, "&endblock=").concat(endBlock) + "&page=".concat(page, "&offset=").concat(offset, "&sort=asc&apikey=").concat(API_KEY);
12690
12706
  _context13.next = 4;
12691
- return fetchJSON(url);
12707
+ return fetchJSON(url, "EOA");
12692
12708
 
12693
12709
  case 4:
12694
12710
  data = _context13.sent;
@@ -12963,8 +12979,8 @@ function _typeof(o) {
12963
12979
  }));
12964
12980
 
12965
12981
  case 39:
12966
- return _context18.abrupt("return", json.results.map((function(_ref5) {
12967
- var confirmations = _ref5.confirmations, dataDecoded = _ref5.dataDecoded, rest = _objectWithoutProperties(_ref5, _excluded);
12982
+ return _context18.abrupt("return", json.results.map((function(_ref6) {
12983
+ var confirmations = _ref6.confirmations, dataDecoded = _ref6.dataDecoded, rest = _objectWithoutProperties(_ref6, _excluded);
12968
12984
  return rest;
12969
12985
  })));
12970
12986
 
@@ -13491,6 +13507,7 @@ function _typeof(o) {
13491
13507
  exports.MIN = MIN;
13492
13508
  exports.MINA = MINA;
13493
13509
  exports.MINIFS = MINIFS;
13510
+ exports.MINUS = MINUS$1;
13494
13511
  exports.MINUTE = MINUTE;
13495
13512
  exports.MIRR = MIRR;
13496
13513
  exports.MMULT = MMULT;