@lowentry/utils 1.23.1 → 1.23.2

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
@@ -1590,7 +1590,7 @@ var LeUtils = {
1590
1590
  * @returns {{remove:Function}}
1591
1591
  */
1592
1592
  setTimeout: function setTimeout(callback, ms) {
1593
- var _performance$now, _performance, _performance$now2;
1593
+ var _globalThis$performan, _globalThis$performan2, _globalThis$performan3;
1594
1594
  if (!(globalThis !== null && globalThis !== void 0 && globalThis.setTimeout) || !(globalThis !== null && globalThis !== void 0 && globalThis.clearTimeout)) {
1595
1595
  console.warn('LeUtils.setTimeout() called in an environment without globalThis.setTimeout, returning a no-op handler.');
1596
1596
  return {
@@ -1598,11 +1598,11 @@ var LeUtils = {
1598
1598
  };
1599
1599
  }
1600
1600
  ms = FLOAT_LAX(ms);
1601
- var lastTime = (_performance$now = (_performance = performance) === null || _performance === void 0 || (_performance$now2 = _performance.now) === null || _performance$now2 === void 0 ? void 0 : _performance$now2.call(_performance)) !== null && _performance$now !== void 0 ? _performance$now : 0;
1601
+ var lastTime = (_globalThis$performan = globalThis === null || globalThis === void 0 || (_globalThis$performan2 = globalThis.performance) === null || _globalThis$performan2 === void 0 || (_globalThis$performan3 = _globalThis$performan2.now) === null || _globalThis$performan3 === void 0 ? void 0 : _globalThis$performan3.call(_globalThis$performan2)) !== null && _globalThis$performan !== void 0 ? _globalThis$performan : 0;
1602
1602
  /** @type {number|null} */
1603
1603
  var handler = globalThis.setTimeout(function () {
1604
- var _performance$now3, _performance2, _performance2$now;
1605
- var currentTime = (_performance$now3 = (_performance2 = performance) === null || _performance2 === void 0 || (_performance2$now = _performance2.now) === null || _performance2$now === void 0 ? void 0 : _performance2$now.call(_performance2)) !== null && _performance$now3 !== void 0 ? _performance$now3 : 0;
1604
+ var _globalThis$performan4, _globalThis$performan5, _globalThis$performan6;
1605
+ var currentTime = (_globalThis$performan4 = globalThis === null || globalThis === void 0 || (_globalThis$performan5 = globalThis.performance) === null || _globalThis$performan5 === void 0 || (_globalThis$performan6 = _globalThis$performan5.now) === null || _globalThis$performan6 === void 0 ? void 0 : _globalThis$performan6.call(_globalThis$performan5)) !== null && _globalThis$performan4 !== void 0 ? _globalThis$performan4 : 0;
1606
1606
  try {
1607
1607
  callback((currentTime - lastTime) / 1000);
1608
1608
  } catch (e) {
@@ -1630,7 +1630,7 @@ var LeUtils = {
1630
1630
  * @returns {{remove:Function}}
1631
1631
  */
1632
1632
  setInterval: function setInterval(callback) {
1633
- var _performance$now4, _performance3, _performance3$now;
1633
+ var _globalThis$performan7, _globalThis$performan8, _globalThis$performan9;
1634
1634
  var intervalMs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
1635
1635
  var fireImmediately = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1636
1636
  intervalMs = FLOAT_LAX_ANY(intervalMs, 1000);
@@ -1647,11 +1647,11 @@ var LeUtils = {
1647
1647
  remove: function remove() {}
1648
1648
  };
1649
1649
  }
1650
- var lastTime = (_performance$now4 = (_performance3 = performance) === null || _performance3 === void 0 || (_performance3$now = _performance3.now) === null || _performance3$now === void 0 ? void 0 : _performance3$now.call(_performance3)) !== null && _performance$now4 !== void 0 ? _performance$now4 : 0;
1650
+ var lastTime = (_globalThis$performan7 = globalThis === null || globalThis === void 0 || (_globalThis$performan8 = globalThis.performance) === null || _globalThis$performan8 === void 0 || (_globalThis$performan9 = _globalThis$performan8.now) === null || _globalThis$performan9 === void 0 ? void 0 : _globalThis$performan9.call(_globalThis$performan8)) !== null && _globalThis$performan7 !== void 0 ? _globalThis$performan7 : 0;
1651
1651
  /** @type {number|null} */
1652
1652
  var handler = globalThis.setInterval(function () {
1653
- var _performance$now5, _performance4, _performance4$now;
1654
- var currentTime = (_performance$now5 = (_performance4 = performance) === null || _performance4 === void 0 || (_performance4$now = _performance4.now) === null || _performance4$now === void 0 ? void 0 : _performance4$now.call(_performance4)) !== null && _performance$now5 !== void 0 ? _performance$now5 : 0;
1653
+ var _globalThis$performan0, _globalThis$performan1, _globalThis$performan10;
1654
+ var currentTime = (_globalThis$performan0 = globalThis === null || globalThis === void 0 || (_globalThis$performan1 = globalThis.performance) === null || _globalThis$performan1 === void 0 || (_globalThis$performan10 = _globalThis$performan1.now) === null || _globalThis$performan10 === void 0 ? void 0 : _globalThis$performan10.call(_globalThis$performan1)) !== null && _globalThis$performan0 !== void 0 ? _globalThis$performan0 : 0;
1655
1655
  try {
1656
1656
  callback((currentTime - lastTime) / 1000);
1657
1657
  } catch (e) {
@@ -1678,7 +1678,7 @@ var LeUtils = {
1678
1678
  * @returns {{remove:Function}}
1679
1679
  */
1680
1680
  setAnimationFrameTimeout: function setAnimationFrameTimeout(callback) {
1681
- var _performance$now6, _performance5, _performance5$now;
1681
+ var _globalThis$performan11, _globalThis$performan12, _globalThis$performan13;
1682
1682
  var frames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
1683
1683
  if (!(globalThis !== null && globalThis !== void 0 && globalThis.requestAnimationFrame) || !(globalThis !== null && globalThis !== void 0 && globalThis.cancelAnimationFrame)) {
1684
1684
  console.warn('LeUtils.setAnimationFrameTimeout() called in an environment without globalThis.requestAnimationFrame, returning a no-op handler.');
@@ -1689,14 +1689,14 @@ var LeUtils = {
1689
1689
  frames = INT_LAX_ANY(frames, 1);
1690
1690
  var run = true;
1691
1691
  var requestAnimationFrameId = null;
1692
- var lastTime = (_performance$now6 = (_performance5 = performance) === null || _performance5 === void 0 || (_performance5$now = _performance5.now) === null || _performance5$now === void 0 ? void 0 : _performance5$now.call(_performance5)) !== null && _performance$now6 !== void 0 ? _performance$now6 : 0;
1692
+ var lastTime = (_globalThis$performan11 = globalThis === null || globalThis === void 0 || (_globalThis$performan12 = globalThis.performance) === null || _globalThis$performan12 === void 0 || (_globalThis$performan13 = _globalThis$performan12.now) === null || _globalThis$performan13 === void 0 ? void 0 : _globalThis$performan13.call(_globalThis$performan12)) !== null && _globalThis$performan11 !== void 0 ? _globalThis$performan11 : 0;
1693
1693
  var _tick = function tick() {
1694
1694
  if (run) {
1695
1695
  if (frames <= 0) {
1696
- var _performance$now7, _performance6, _performance6$now;
1696
+ var _globalThis$performan14, _globalThis$performan15, _globalThis$performan16;
1697
1697
  run = false;
1698
1698
  requestAnimationFrameId = null;
1699
- var currentTime = (_performance$now7 = (_performance6 = performance) === null || _performance6 === void 0 || (_performance6$now = _performance6.now) === null || _performance6$now === void 0 ? void 0 : _performance6$now.call(_performance6)) !== null && _performance$now7 !== void 0 ? _performance$now7 : 0;
1699
+ var currentTime = (_globalThis$performan14 = globalThis === null || globalThis === void 0 || (_globalThis$performan15 = globalThis.performance) === null || _globalThis$performan15 === void 0 || (_globalThis$performan16 = _globalThis$performan15.now) === null || _globalThis$performan16 === void 0 ? void 0 : _globalThis$performan16.call(_globalThis$performan15)) !== null && _globalThis$performan14 !== void 0 ? _globalThis$performan14 : 0;
1700
1700
  try {
1701
1701
  callback((currentTime - lastTime) / 1000);
1702
1702
  } catch (e) {
@@ -1731,7 +1731,7 @@ var LeUtils = {
1731
1731
  * @returns {{remove:Function}}
1732
1732
  */
1733
1733
  setAnimationFrameInterval: function setAnimationFrameInterval(callback) {
1734
- var _performance$now8, _performance7, _performance7$now;
1734
+ var _globalThis$performan17, _globalThis$performan18, _globalThis$performan19;
1735
1735
  var intervalFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
1736
1736
  var fireImmediately = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1737
1737
  intervalFrames = INT_LAX_ANY(intervalFrames, 1);
@@ -1750,13 +1750,13 @@ var LeUtils = {
1750
1750
  }
1751
1751
  var run = true;
1752
1752
  var requestAnimationFrameId = null;
1753
- var lastTime = (_performance$now8 = (_performance7 = performance) === null || _performance7 === void 0 || (_performance7$now = _performance7.now) === null || _performance7$now === void 0 ? void 0 : _performance7$now.call(_performance7)) !== null && _performance$now8 !== void 0 ? _performance$now8 : 0;
1753
+ var lastTime = (_globalThis$performan17 = globalThis === null || globalThis === void 0 || (_globalThis$performan18 = globalThis.performance) === null || _globalThis$performan18 === void 0 || (_globalThis$performan19 = _globalThis$performan18.now) === null || _globalThis$performan19 === void 0 ? void 0 : _globalThis$performan19.call(_globalThis$performan18)) !== null && _globalThis$performan17 !== void 0 ? _globalThis$performan17 : 0;
1754
1754
  var frames = intervalFrames;
1755
1755
  var _tick2 = function tick() {
1756
1756
  if (run) {
1757
1757
  if (frames <= 0) {
1758
- var _performance$now9, _performance8, _performance8$now;
1759
- var currentTime = (_performance$now9 = (_performance8 = performance) === null || _performance8 === void 0 || (_performance8$now = _performance8.now) === null || _performance8$now === void 0 ? void 0 : _performance8$now.call(_performance8)) !== null && _performance$now9 !== void 0 ? _performance$now9 : 0;
1758
+ var _globalThis$performan20, _globalThis$performan21, _globalThis$performan22;
1759
+ var currentTime = (_globalThis$performan20 = globalThis === null || globalThis === void 0 || (_globalThis$performan21 = globalThis.performance) === null || _globalThis$performan21 === void 0 || (_globalThis$performan22 = _globalThis$performan21.now) === null || _globalThis$performan22 === void 0 ? void 0 : _globalThis$performan22.call(_globalThis$performan21)) !== null && _globalThis$performan20 !== void 0 ? _globalThis$performan20 : 0;
1760
1760
  try {
1761
1761
  callback((currentTime - lastTime) / 1000);
1762
1762
  } catch (e) {
@@ -2342,9 +2342,9 @@ var LeUtils = {
2342
2342
  var generateUniqueId = function generateUniqueId() {
2343
2343
  var now;
2344
2344
  try {
2345
- var _performance9, _performance0, _performance$now0, _performance1, _performance1$now;
2345
+ var _globalThis$performan23, _globalThis$performan24, _globalThis$performan25, _globalThis$performan26, _globalThis$performan27;
2346
2346
  // noinspection JSDeprecatedSymbols
2347
- now = (((_performance9 = performance) === null || _performance9 === void 0 ? void 0 : _performance9.timeOrigin) || ((_performance0 = performance) === null || _performance0 === void 0 || (_performance0 = _performance0.timing) === null || _performance0 === void 0 ? void 0 : _performance0.navigationStart) || 0) + ((_performance$now0 = (_performance1 = performance) === null || _performance1 === void 0 || (_performance1$now = _performance1.now) === null || _performance1$now === void 0 ? void 0 : _performance1$now.call(_performance1)) !== null && _performance$now0 !== void 0 ? _performance$now0 : 0);
2347
+ now = ((globalThis === null || globalThis === void 0 || (_globalThis$performan23 = globalThis.performance) === null || _globalThis$performan23 === void 0 ? void 0 : _globalThis$performan23.timeOrigin) || (globalThis === null || globalThis === void 0 || (_globalThis$performan24 = globalThis.performance) === null || _globalThis$performan24 === void 0 || (_globalThis$performan24 = _globalThis$performan24.timing) === null || _globalThis$performan24 === void 0 ? void 0 : _globalThis$performan24.navigationStart) || 0) + ((_globalThis$performan25 = globalThis === null || globalThis === void 0 || (_globalThis$performan26 = globalThis.performance) === null || _globalThis$performan26 === void 0 || (_globalThis$performan27 = _globalThis$performan26.now) === null || _globalThis$performan27 === void 0 ? void 0 : _globalThis$performan27.call(_globalThis$performan26)) !== null && _globalThis$performan25 !== void 0 ? _globalThis$performan25 : 0);
2348
2348
  } catch (e) {}
2349
2349
  now = now || (Date.now ? Date.now() : new Date().getTime());
2350
2350
  now = Math.round(now);
@@ -2415,9 +2415,9 @@ var LeUtils = {
2415
2415
  now = FLOAT_LAX(now);
2416
2416
  } else {
2417
2417
  try {
2418
- var _performance10, _performance11, _performance$now1, _performance12, _performance12$now;
2418
+ var _performance, _performance2, _performance$now, _performance3, _performance3$now;
2419
2419
  // noinspection JSDeprecatedSymbols
2420
- now = (((_performance10 = performance) === null || _performance10 === void 0 ? void 0 : _performance10.timeOrigin) || ((_performance11 = performance) === null || _performance11 === void 0 || (_performance11 = _performance11.timing) === null || _performance11 === void 0 ? void 0 : _performance11.navigationStart) || 0) + ((_performance$now1 = (_performance12 = performance) === null || _performance12 === void 0 || (_performance12$now = _performance12.now) === null || _performance12$now === void 0 ? void 0 : _performance12$now.call(_performance12)) !== null && _performance$now1 !== void 0 ? _performance$now1 : 0);
2420
+ now = (((_performance = performance) === null || _performance === void 0 ? void 0 : _performance.timeOrigin) || ((_performance2 = performance) === null || _performance2 === void 0 || (_performance2 = _performance2.timing) === null || _performance2 === void 0 ? void 0 : _performance2.navigationStart) || 0) + ((_performance$now = (_performance3 = performance) === null || _performance3 === void 0 || (_performance3$now = _performance3.now) === null || _performance3$now === void 0 ? void 0 : _performance3$now.call(_performance3)) !== null && _performance$now !== void 0 ? _performance$now : 0);
2421
2421
  } catch (e) {}
2422
2422
  now = now || (Date.now ? Date.now() : new Date().getTime());
2423
2423
  }