Skip to content

Commit

Permalink
add offset option
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas-lormeau committed Aug 21, 2024
1 parent 3616673 commit 3368a4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,10 @@ export interface ZipWriterConstructorOptions {
* `true` to write encrypted data when `passThrough` is set to `true`.
*/
encrypted?: boolean;
/**
* The offset of the first entry in the zip file.
*/
offset?: number;
/**
* Encode the filename and the comment of the entry.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/core/zip-writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ZipWriter {
config: getConfiguration(),
files: new Map(),
filenames: new Set(),
offset: writer.writable.size,
offset: options.offset === UNDEFINED_VALUE ? writer.writable.size : options.offset,
pendingEntriesSize: 0,
pendingAddFileCalls: new Set(),
bufferedWrites: 0
Expand Down

0 comments on commit 3368a4f

Please sign in to comment.