@sourceregistry/node-webserver 1.7.0 → 1.7.1

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/dist/index.es.js CHANGED
@@ -49,7 +49,7 @@ var E = class {
49
49
  this.cleanupInterval = setInterval(() => {
50
50
  let e = Date.now();
51
51
  for (let [t, { reset: n }] of this.data) e >= n && this.data.delete(t);
52
- }, Math.min(this.windowMs, 3e5));
52
+ }, Math.min(this.windowMs, 3e5)), this.cleanupInterval?.unref();
53
53
  }
54
54
  stop() {
55
55
  this.cleanupInterval && clearInterval(this.cleanupInterval);
@@ -77,7 +77,7 @@ var E = class {
77
77
  let r = e - this.windowMs, i = n.filter((e) => e > r);
78
78
  i.length === 0 ? this.data.delete(t) : this.data.set(t, i);
79
79
  }
80
- }, Math.min(this.windowMs, 3e5));
80
+ }, Math.min(this.windowMs, 3e5)), this.cleanupInterval.unref();
81
81
  }
82
82
  stop() {
83
83
  this.cleanupInterval && clearInterval(this.cleanupInterval);
@@ -415,6 +415,9 @@ var H = [
415
415
  useMiddleware(...e) {
416
416
  return this._middlewares.push(...e), this;
417
417
  }
418
+ middleware(...e) {
419
+ return this._middlewares.push(...e), this;
420
+ }
418
421
  pre(...e) {
419
422
  return this._preHandlers.push(...e), this;
420
423
  }