Check TypeScript for backend (#64)

* Check Typescript

* Fix backend typescript issues

* Update
This commit is contained in:
Louis Lam
2023-11-18 15:54:43 +08:00
committed by GitHub
parent 13c3dac44d
commit 53b052c1e5
18 changed files with 155 additions and 112 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();