const archiveFile = await Archive.write({
files: [
{
// Error: Property 'file' is missing in type 'File' but required in type 'ArchiveEntryFile'. (TS2741)
file: new File(['test'], 'test.tar.gz'),
pathname: 'folder/file.zip',
},
],
outputFileName: 'test.tar.gz',
compression: ArchiveCompression.GZIP,
format: ArchiveFormat.USTAR,
passphrase: null,
});
This is identical to the README.md example except for passing a file instance directly. I currently have the following local patch to prevent the error:
# patches/libarchive.js+2.0.2.patch
diff --git a/node_modules/libarchive.js/dist/build/compiled/libarchive.d.ts b/node_modules/libarchive.js/dist/build/compiled/libarchive.d.ts
index 19ec630..637b9a9 100644
--- a/node_modules/libarchive.js/dist/build/compiled/libarchive.d.ts
+++ b/node_modules/libarchive.js/dist/build/compiled/libarchive.d.ts
@@ -7,7 +7,7 @@ export type ArchiveOptions = {
createClient?: (worker: any) => any;
};
export type ArchiveEntryFile = {
- file: ArchiveEntryFile;
+ file: File | Blob;
pathname?: string;
};
export type ArchiveWriteOptions = {
Does the above change look correct? If so I can make a PR for it.
This is identical to the README.md example except for passing a file instance directly. I currently have the following local patch to prevent the error:
Does the above change look correct? If so I can make a PR for it.