Skip to content

Commit eb26c8e

Browse files
authored
Add files via upload
(Possible) Bug Fix: Anti Virus flagged generated zip.
1 parent a453c5c commit eb26c8e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

items-json-generator.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -679,11 +679,11 @@ <h1>Items.json Generator</h1>
679679
const pageIndex = i / CHUNK_SIZE;
680680
const chunk = items.slice(i, i + CHUNK_SIZE);
681681
pageCounts.push(chunk.length);
682-
zip.file(`items_${pageIndex}.json`, JSON.stringify(chunk, null, 2));
682+
zip.file(`items_${pageIndex}.json`, JSON.stringify(chunk, null, 2), {date: new Date(), compression: "DEFLATE"});
683683
}
684684
const meta = { totalItems: items.length, pageCounts: pageCounts };
685-
zip.file('items_meta.json', JSON.stringify(meta, null, 2));
686-
zip.generateAsync({ type: 'blob' }).then(content => {
685+
zip.file('items_meta.json', JSON.stringify(meta, null, 2), {date: new Date(), compression: "DEFLATE"});
686+
zip.generateAsync({ type: 'blob', compression: "DEFLATE", compressionOptions: { level: 6 } }).then(content => {
687687
const url = URL.createObjectURL(content);
688688
const a = document.createElement('a');
689689
a.href = url;
@@ -705,4 +705,4 @@ <h1>Items.json Generator</h1>
705705
};
706706
</script>
707707
</body>
708-
</html>
708+
</html>

0 commit comments

Comments
 (0)