@lowentry/utils 1.13.1 → 1.13.3

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/index.js CHANGED
@@ -271,19 +271,19 @@ var LeUtils = {
271
271
  return LeUtils.setTimeout(callback, 0);
272
272
  } else {
273
273
  var listening = true;
274
- var callbackWrapper = function callbackWrapper() {
274
+ var _callbackWrapper = function callbackWrapper() {
275
275
  if (listening) {
276
276
  listening = false;
277
- document.removeEventListener('DOMContentLoaded', callbackWrapper);
277
+ document.removeEventListener('DOMContentLoaded', _callbackWrapper);
278
278
  callback();
279
279
  }
280
280
  };
281
- document.addEventListener('DOMContentLoaded', callbackWrapper);
281
+ document.addEventListener('DOMContentLoaded', _callbackWrapper);
282
282
  return {
283
283
  remove: function remove() {
284
284
  if (listening) {
285
285
  listening = false;
286
- document.removeEventListener('DOMContentLoaded', callbackWrapper);
286
+ document.removeEventListener('DOMContentLoaded', _callbackWrapper);
287
287
  }
288
288
  }
289
289
  };
@@ -643,7 +643,7 @@ var LeUtils = {
643
643
  */
644
644
  eachAsync: function () {
645
645
  var eachAsyncParallel = /*#__PURE__*/function () {
646
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(elements, asyncCallback, optionalParallelCount, optionalSkipHasOwnPropertyCheck) {
646
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(elements, asyncCallback, optionalParallelCount, optionalSkipHasOwnPropertyCheck) {
647
647
  var promises, doBreak;
648
648
  return _regeneratorRuntime.wrap(function _callee3$(_context4) {
649
649
  while (1) switch (_context4.prev = _context4.next) {
@@ -652,7 +652,7 @@ var LeUtils = {
652
652
  doBreak = false;
653
653
  _context4.next = 4;
654
654
  return LeUtils.eachAsync(elements, /*#__PURE__*/function () {
655
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(element, index) {
655
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(element, index) {
656
656
  var _loop, promise;
657
657
  return _regeneratorRuntime.wrap(function _callee2$(_context3) {
658
658
  while (1) switch (_context3.prev = _context3.next) {
@@ -697,7 +697,7 @@ var LeUtils = {
697
697
  }
698
698
  return _context3.abrupt("return", false);
699
699
  case 7:
700
- promise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
700
+ promise = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
701
701
  return _regeneratorRuntime.wrap(function _callee$(_context) {
702
702
  while (1) switch (_context.prev = _context.next) {
703
703
  case 0:
@@ -745,7 +745,7 @@ var LeUtils = {
745
745
  };
746
746
  }();
747
747
  return /*#__PURE__*/function () {
748
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(elements, asyncCallback) {
748
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(elements, asyncCallback) {
749
749
  var parallelCount,
750
750
  optionalSkipHasOwnPropertyCheck,
751
751
  index,
@@ -1045,13 +1045,13 @@ var LeUtils = {
1045
1045
  * @returns {*[]}
1046
1046
  */
1047
1047
  flattenArray: function () {
1048
- var flattenArrayRecursive = function flattenArrayRecursive(result, array) {
1048
+ var _flattenArrayRecursive = function flattenArrayRecursive(result, array) {
1049
1049
  if (!Array.isArray(array)) {
1050
1050
  result.push(array);
1051
1051
  return;
1052
1052
  }
1053
1053
  array.forEach(function (entry) {
1054
- flattenArrayRecursive(result, entry);
1054
+ _flattenArrayRecursive(result, entry);
1055
1055
  });
1056
1056
  };
1057
1057
  return function (array) {
@@ -1060,7 +1060,7 @@ var LeUtils = {
1060
1060
  }
1061
1061
  var result = [];
1062
1062
  array.forEach(function (entry) {
1063
- flattenArrayRecursive(result, entry);
1063
+ _flattenArrayRecursive(result, entry);
1064
1064
  });
1065
1065
  return result;
1066
1066
  };
@@ -1161,7 +1161,7 @@ var LeUtils = {
1161
1161
  }
1162
1162
  }, _callee5);
1163
1163
  }).constructor;
1164
- var AsyncGeneratorFunction = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
1164
+ var AsyncGeneratorFunction = _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
1165
1165
  return _regeneratorRuntime.wrap(function _callee6$(_context7) {
1166
1166
  while (1) switch (_context7.prev = _context7.next) {
1167
1167
  case 0:
@@ -1313,7 +1313,7 @@ var LeUtils = {
1313
1313
  var run = true;
1314
1314
  var requestAnimationFrameId = null;
1315
1315
  var lastTime = performance.now();
1316
- var tick = function tick() {
1316
+ var _tick = function tick() {
1317
1317
  if (run) {
1318
1318
  if (frames <= 0) {
1319
1319
  run = false;
@@ -1328,10 +1328,10 @@ var LeUtils = {
1328
1328
  return;
1329
1329
  }
1330
1330
  frames--;
1331
- requestAnimationFrameId = typeof window === 'undefined' ? setTimeout(tick, 1000 / 60) : requestAnimationFrame(tick);
1331
+ requestAnimationFrameId = typeof window === 'undefined' ? setTimeout(_tick, 1000 / 60) : requestAnimationFrame(_tick);
1332
1332
  }
1333
1333
  };
1334
- tick();
1334
+ _tick();
1335
1335
  return {
1336
1336
  remove: function remove() {
1337
1337
  run = false;
@@ -1376,7 +1376,7 @@ var LeUtils = {
1376
1376
  var requestAnimationFrameId = null;
1377
1377
  var lastTime = performance.now();
1378
1378
  var frames = intervalFrames;
1379
- var tick = function tick() {
1379
+ var _tick2 = function tick() {
1380
1380
  if (run) {
1381
1381
  if (frames <= 0) {
1382
1382
  var currentTime = performance.now();
@@ -1390,11 +1390,11 @@ var LeUtils = {
1390
1390
  }
1391
1391
  frames--;
1392
1392
  if (run) {
1393
- requestAnimationFrameId = typeof window === 'undefined' ? setTimeout(tick, 1000 / 60) : requestAnimationFrame(tick);
1393
+ requestAnimationFrameId = typeof window === 'undefined' ? setTimeout(_tick2, 1000 / 60) : requestAnimationFrame(_tick2);
1394
1394
  }
1395
1395
  }
1396
1396
  };
1397
- typeof window === 'undefined' ? setTimeout(tick, 1000 / 60) : requestAnimationFrame(tick);
1397
+ typeof window === 'undefined' ? setTimeout(_tick2, 1000 / 60) : requestAnimationFrame(_tick2);
1398
1398
  return {
1399
1399
  remove: function remove() {
1400
1400
  run = false;
@@ -1462,13 +1462,13 @@ var LeUtils = {
1462
1462
  if (typeof window !== 'undefined' && typeof window.AbortController !== 'undefined') {
1463
1463
  controller = new AbortController();
1464
1464
  }
1465
- var promise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
1466
- var attemptFetch;
1465
+ var promise = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
1466
+ var _attemptFetch;
1467
1467
  return _regeneratorRuntime.wrap(function _callee8$(_context9) {
1468
1468
  while (1) switch (_context9.prev = _context9.next) {
1469
1469
  case 0:
1470
- attemptFetch = /*#__PURE__*/function () {
1471
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
1470
+ _attemptFetch = /*#__PURE__*/function () {
1471
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
1472
1472
  var _controller;
1473
1473
  var _controller2, response, _controller3;
1474
1474
  return _regeneratorRuntime.wrap(function _callee7$(_context8) {
@@ -1517,7 +1517,7 @@ var LeUtils = {
1517
1517
  return LeUtils.promiseTimeout(typeof (options === null || options === void 0 ? void 0 : options.delay) === 'function' ? INT_LAX_ANY(options === null || options === void 0 ? void 0 : options.delay(currentRetries), 500) : INT_LAX_ANY(options === null || options === void 0 ? void 0 : options.delay, 500));
1518
1518
  case 20:
1519
1519
  _context8.next = 22;
1520
- return attemptFetch();
1520
+ return _attemptFetch();
1521
1521
  case 22:
1522
1522
  return _context8.abrupt("return", _context8.sent);
1523
1523
  case 23:
@@ -1531,7 +1531,7 @@ var LeUtils = {
1531
1531
  };
1532
1532
  }();
1533
1533
  _context9.next = 3;
1534
- return attemptFetch();
1534
+ return _attemptFetch();
1535
1535
  case 3:
1536
1536
  return _context9.abrupt("return", _context9.sent);
1537
1537
  case 4: