uptime-kuma/server/limit-array.js
2021-09-08 18:58:02 +08:00

13 lines
226 B
JavaScript

class LimitArray {
limit = 100;
array = [];
add(item) {
this.array.push(item);
if (this.array.length > this.limit) {
this.array.shift();
}
}
}
module.exports = LimitArray;