@oxog/devinspector 1.5.1 → 1.5.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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generateId,
3
3
  parseStackFrame
4
- } from "./chunk-NP2SAIEA.js";
4
+ } from "./chunk-D4LKJXON.js";
5
5
 
6
6
  // src/monitors/error/error-tracker.ts
7
7
  function isInstance(value, name) {
@@ -396,4 +396,4 @@ var ErrorMonitor = class {
396
396
  export {
397
397
  ErrorMonitor
398
398
  };
399
- //# sourceMappingURL=error-monitor-AVTYBTS7.js.map
399
+ //# sourceMappingURL=error-monitor-I6H3VVLI.js.map
package/dist/index.cjs CHANGED
@@ -91,7 +91,7 @@ function throttle(func, wait, options = {}) {
91
91
  result = func.apply(thisArg, args);
92
92
  return result;
93
93
  };
94
- return function throttled(...args) {
94
+ const throttled = function(...args) {
95
95
  const now = Date.now();
96
96
  const remaining = wait - (now - lastCallTime);
97
97
  lastThis = this;
@@ -116,6 +116,14 @@ function throttle(func, wait, options = {}) {
116
116
  }
117
117
  return result;
118
118
  };
119
+ throttled.cancel = () => {
120
+ if (timeout) {
121
+ clearTimeout(timeout);
122
+ timeout = null;
123
+ }
124
+ lastArgs = lastThis = null;
125
+ };
126
+ return throttled;
119
127
  }
120
128
  function generateId() {
121
129
  return `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
@@ -2077,7 +2085,9 @@ var init_performance_monitor = __esm({
2077
2085
  this.memoryMonitor = new MemoryMonitor(this.handleMemoryData.bind(this));
2078
2086
  this.metricsCollector = new MetricsCollector(this.handleMetrics.bind(this));
2079
2087
  this.longTaskDetector = new LongTaskDetector(this.handleLongTask.bind(this));
2080
- this.emitPerformanceData = throttle(this.emitPerformanceData.bind(this), 100);
2088
+ const throttledEmit = throttle(this.emitPerformanceData.bind(this), 100);
2089
+ this.emitPerformanceData = throttledEmit;
2090
+ this.cancelPendingEmit = throttledEmit.cancel;
2081
2091
  }
2082
2092
  start() {
2083
2093
  if (this.isActive) return;
@@ -2095,6 +2105,7 @@ var init_performance_monitor = __esm({
2095
2105
  this.memoryMonitor.stop();
2096
2106
  this.metricsCollector.stop();
2097
2107
  this.longTaskDetector.stop();
2108
+ this.cancelPendingEmit();
2098
2109
  this.isActive = false;
2099
2110
  }
2100
2111
  handleFPSData(data) {
@@ -4288,7 +4299,7 @@ var BasePlugin = class {
4288
4299
  };
4289
4300
 
4290
4301
  // src/version.ts
4291
- var VERSION = "1.5.1";
4302
+ var VERSION = "1.5.2";
4292
4303
 
4293
4304
  // src/enhanced-simple.ts
4294
4305
  var CONSOLE_METHODS = ["log", "info", "warn", "error", "debug"];