Skip to content

Commit d6a116d

Browse files
committed
fix: don't use apis from iterator helpers proposal
Signed-off-by: Mirza Brunjadze <[email protected]>
1 parent 83b3690 commit d6a116d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/clients/consumer/consumer.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,14 @@ export class Consumer<Key = Buffer, Value = Buffer, HeaderKey = Buffer, HeaderVa
342342
}
343343

344344
paused (): TopicPartition[] {
345-
return this.#pausedPartitions
346-
.entries()
347-
.flatMap(([topic, partitions]) => Array.from(partitions).map(partition => ({ topic, partition })))
348-
.toArray()
345+
const result: TopicPartition[] = []
346+
for (const [topic, partitions] of this.#pausedPartitions.entries()) {
347+
for (const partition of partitions) {
348+
result.push({ topic, partition })
349+
}
350+
}
351+
352+
return result
349353
}
350354

351355
isPaused (partition: TopicPartition): boolean {

0 commit comments

Comments
 (0)