diff --git a/libraries/stream-extra/src/consumable.ts b/libraries/stream-extra/src/consumable.ts index 7a8ae48fa..5e7cec457 100644 --- a/libraries/stream-extra/src/consumable.ts +++ b/libraries/stream-extra/src/consumable.ts @@ -47,7 +47,7 @@ export class Consumable { this.#resolver.resolve(); } - error(error: any) { + error(error: unknown) { this.#resolver.reject(error); } @@ -55,7 +55,7 @@ export class Consumable { try { // eslint-disable-next-line @typescript-eslint/await-thenable const result = await this.#task.run(() => callback(this.value)); - this.consume(); + this.#resolver.resolve(); return result; } catch (e) { this.#resolver.reject(e); @@ -212,7 +212,6 @@ export class ConsumableWritableStream extends WritableStream> { await chunk.tryConsume( (value) => sink.write?.(value, controller), ); - chunk.consume(); }, abort(reason) { return sink.abort?.(reason);