mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
fix: types
This commit is contained in:
parent
b9117f5524
commit
1e9286c999
@ -13,7 +13,7 @@ export class DynamicBucket {
|
|||||||
queue: ((value?: unknown) => any)[] = [];
|
queue: ((value?: unknown) => any)[] = [];
|
||||||
used = 0;
|
used = 0;
|
||||||
processing?: boolean;
|
processing?: boolean;
|
||||||
refillsAt? = 0;
|
refillsAt?: number;
|
||||||
timeoutId?: NodeJS.Timeout;
|
timeoutId?: NodeJS.Timeout;
|
||||||
|
|
||||||
constructor(public options: DynamicBucketOptions) {}
|
constructor(public options: DynamicBucketOptions) {}
|
||||||
@ -76,7 +76,7 @@ export class DynamicBucket {
|
|||||||
static chunk<T>(array: T[], chunks: number): T[][] {
|
static chunk<T>(array: T[], chunks: number): T[][] {
|
||||||
let index = 0;
|
let index = 0;
|
||||||
let resIndex = 0;
|
let resIndex = 0;
|
||||||
const result = Array(Math.ceil(array.length / chunks));
|
const result = new Array<T[]>(Math.ceil(array.length / chunks));
|
||||||
|
|
||||||
while (index < array.length) {
|
while (index < array.length) {
|
||||||
result[resIndex] = array.slice(index, (index += chunks));
|
result[resIndex] = array.slice(index, (index += chunks));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user