mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-09-07 18:02:42 +00:00
14 lines
226 B
JavaScript
14 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;
|