Skip to content

Commit 069d6e9

Browse files
committed
review - writer.write returns after save completion
1 parent db9645c commit 069d6e9

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ async function save(
192192
});
193193
await writer.write(...files);
194194
await writer.close();
195-
await writer.done();
196195
return;
197196
}
198197

src/zip.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -368,19 +368,14 @@ export class PenumbraZipWriter extends EventTarget {
368368
await this.writer.close();
369369
this.closed = true;
370370
}
371+
/**
372+
* Await completion of the underlying zip stream being written to the sink
373+
* @returns Promise that resolves when the sink write completes
374+
*/
375+
await this.pipePromise;
371376
return size;
372377
}
373378

374-
/**
375-
* Await completion of the underlying zip stream being written to the sink
376-
* @returns Promise that resolves when the sink write completes
377-
*/
378-
async done(): Promise<void> {
379-
if (this.pipePromise) {
380-
await this.pipePromise;
381-
}
382-
}
383-
384379
/** Cancel Penumbra zip writer */
385380
abort(): void {
386381
if (!this.controller.signal.aborted) {

tests/api.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ describe('Penumbra API', () => {
479479
})),
480480
);
481481
await writer.close();
482-
await writer.done();
483482
assert.isTrue(
484483
progressEventFiredAndWorking,
485484
'zip progress event fired & emitted expected properties',

0 commit comments

Comments
 (0)