@fileverse-dev/formulajs 4.4.11-mod-9 → 4.4.11-mod-11

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-9 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-11 */
2
2
  function _slicedToArray(r, e) {
3
3
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
4
4
  }
@@ -10762,7 +10762,7 @@ function _typeof(o) {
10762
10762
  }
10763
10763
  function _GETPRICE() {
10764
10764
  _GETPRICE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(token, vs_currencies) {
10765
- var API_KEY, url, options, response, jsonResponse, output, _i0, _Object$entries, _Object$entries$_i, coin, prices, _i1, _Object$entries2, _Object$entries2$_i, currency, _value5, key;
10765
+ var API_KEY, url, options, response, json, jsonResponse, output, _i0, _Object$entries, _Object$entries$_i, coin, prices, _i1, _Object$entries2, _Object$entries2$_i, currency, _value5, key;
10766
10766
  return _regeneratorRuntime().wrap((function _callee2$(_context2) {
10767
10767
  while (1) switch (_context2.prev = _context2.next) {
10768
10768
  case 0:
@@ -10782,16 +10782,25 @@ function _typeof(o) {
10782
10782
  case 6:
10783
10783
  response = _context2.sent;
10784
10784
  if (response.ok) {
10785
- _context2.next = 9;
10785
+ _context2.next = 13;
10786
10786
  break;
10787
10787
  }
10788
- throw new Error("HTTP error! Status: ".concat(response.status));
10788
+ _context2.next = 10;
10789
+ return response.json();
10789
10790
 
10790
- case 9:
10791
- _context2.next = 11;
10791
+ case 10:
10792
+ json = _context2.sent;
10793
+ if (!json.status.error_message.includes("API Key Missing")) {
10794
+ _context2.next = 13;
10795
+ break;
10796
+ }
10797
+ return _context2.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko, "_MISSING"));
10798
+
10799
+ case 13:
10800
+ _context2.next = 15;
10792
10801
  return response.json();
10793
10802
 
10794
- case 11:
10803
+ case 15:
10795
10804
  jsonResponse = _context2.sent;
10796
10805
  output = {};
10797
10806
  for (_i0 = 0, _Object$entries = Object.entries(jsonResponse); _i0 < _Object$entries.length; _i0++) {
@@ -10806,19 +10815,43 @@ function _typeof(o) {
10806
10815
  }
10807
10816
  return _context2.abrupt("return", [ output ]);
10808
10817
 
10809
- case 17:
10810
- _context2.prev = 17;
10818
+ case 21:
10819
+ _context2.prev = 21;
10811
10820
  _context2.t0 = _context2["catch"](3);
10812
10821
  return _context2.abrupt("return", "ERROR IN FETCHING");
10813
10822
 
10814
- case 20:
10823
+ case 24:
10815
10824
  case "end":
10816
10825
  return _context2.stop();
10817
10826
  }
10818
- }), _callee2, null, [ [ 3, 17 ] ]);
10827
+ }), _callee2, null, [ [ 3, 21 ] ]);
10819
10828
  })));
10820
10829
  return _GETPRICE.apply(this, arguments);
10821
10830
  }
10831
+ function FLVURL(_x6, _x7) {
10832
+ return _FLVURL.apply(this, arguments);
10833
+ }
10834
+ function _FLVURL() {
10835
+ _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee3(token, vs_currencies) {
10836
+ return _regeneratorRuntime().wrap((function _callee3$(_context3) {
10837
+ while (1) switch (_context3.prev = _context3.next) {
10838
+ case 0:
10839
+ return _context3.abrupt("return", new Promise((function(resolve) {
10840
+ setTimeout((function() {
10841
+ resolve([ {
10842
+ Yoo: "gotcha"
10843
+ } ]);
10844
+ }), 1e4);
10845
+ })));
10846
+
10847
+ case 1:
10848
+ case "end":
10849
+ return _context3.stop();
10850
+ }
10851
+ }), _callee3);
10852
+ })));
10853
+ return _FLVURL.apply(this, arguments);
10854
+ }
10822
10855
  var utils = {
10823
10856
  errors: errors,
10824
10857
  symbols: symbols,
@@ -10962,6 +10995,7 @@ function _typeof(o) {
10962
10995
  exports.FLOOR = FLOOR;
10963
10996
  exports.FLOORMATH = FLOORMATH;
10964
10997
  exports.FLOORPRECISE = FLOORPRECISE;
10998
+ exports.FLVURL = FLVURL;
10965
10999
  exports.FORECAST = FORECAST;
10966
11000
  exports.FREQUENCY = FREQUENCY;
10967
11001
  exports.FTEST = FTEST;