Fix backend typescript issues

This commit is contained in:
Louis Lam
2023-11-18 15:43:53 +08:00
parent 2cca168d39
commit f9761daefc
17 changed files with 144 additions and 105 deletions

View File

@@ -4,14 +4,14 @@
*/
export class LimitQueue<T> extends Array<T> {
__limit;
__onExceed = null;
__onExceed? : (item : T | undefined) => void;
constructor(limit: number) {
super();
this.__limit = limit;
}
push(value : T) {
pushItem(value : T) {
super.push(value);
if (this.length > this.__limit) {
const item = this.shift();