From 3877ad15c170cca23a765802fb31837f4883dc01 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 18 Aug 2022 20:25:01 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B0=D1=8F=20=D0=B4=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/ZipReader.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/core/ZipReader.js b/server/core/ZipReader.js index 5b9a128..1693144 100644 --- a/server/core/ZipReader.js +++ b/server/core/ZipReader.js @@ -10,13 +10,14 @@ class ZipReader { throw new Error('Zip closed'); } - async open(zipFile) { + async open(zipFile, zipEntries = true) { if (this.zip) throw new Error('Zip file is already open'); const zip = new StreamZip.async({file: zipFile}); - this.zipEntries = await zip.entries(); + if (zipEntries) + this.zipEntries = await zip.entries(); this.zip = zip; } @@ -49,7 +50,7 @@ class ZipReader { if (this.zip) { this.zip.close(); this.zip = null; - this.zipEntries = null; + this.zipEntries = undefined; } } }