diff --git a/src/websocket/structures/index.ts b/src/websocket/structures/index.ts index ba4590d..70c888a 100644 --- a/src/websocket/structures/index.ts +++ b/src/websocket/structures/index.ts @@ -13,7 +13,7 @@ export class DynamicBucket { queue: ((value?: unknown) => any)[] = []; used = 0; processing?: boolean; - refillsAt? = 0; + refillsAt?: number; timeoutId?: NodeJS.Timeout; constructor(public options: DynamicBucketOptions) {} @@ -76,7 +76,7 @@ export class DynamicBucket { static chunk(array: T[], chunks: number): T[][] { let index = 0; let resIndex = 0; - const result = Array(Math.ceil(array.length / chunks)); + const result = new Array(Math.ceil(array.length / chunks)); while (index < array.length) { result[resIndex] = array.slice(index, (index += chunks));