chore: refactor and comment

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-07-25 13:53:54 +02:00
parent 01d825ba28
commit 764ba707a2
2 changed files with 3 additions and 2 deletions
@@ -111,7 +111,8 @@ export class ZipArchiveResponse implements ReadTreeResponse {
}
zipfile.on('entry', async (entry: Entry) => {
if (!/\/$/.test(entry.fileName) && this.shouldBeIncluded(entry)) {
// Check that the file is not a directory, and that is matches the filter.
if (!entry.fileName.endsWith('/') && this.shouldBeIncluded(entry)) {
zipfile.openReadStream(entry, async (openErr, readStream) => {
if (openErr || !readStream) {
reject(