uptime-kuma/server/limit-array.js

14 lines
226 B
JavaScript
Raw Normal View History

2021-09-08 10:58:02 +00:00
class LimitArray {
limit = 100;
array = [];
add(item) {
this.array.push(item);
if (this.array.length > this.limit) {
this.array.shift();
}
}
}
module.exports = LimitArray;