diff --git a/src/main/helpers/zip.helpers.ts b/src/main/helpers/zip.helpers.ts index d04fd794..cc1604d6 100644 --- a/src/main/helpers/zip.helpers.ts +++ b/src/main/helpers/zip.helpers.ts @@ -6,8 +6,9 @@ import { mkdir, writeFile } from 'fs/promises'; export async function extractZip(zip: JSZip, dest: string): Promise{ if(!await pathExist(dest)){ throw new Error(`Path ${dest} does not exist`); } const files: string[] = []; - await zip.forEach(async (relativePath, entry) => { - if(entry.dir){ return; } + + for(const [relativePath, entry] of Object.entries(zip.files)){ + if(entry.dir){ continue; } const content = await entry.async("nodebuffer"); const outPath = path.join(dest, relativePath); @@ -17,7 +18,7 @@ export async function extractZip(zip: JSZip, dest: string): Promise{ await writeFile(outPath, content); files.push(outPath); - }); + } return files; } \ No newline at end of file