@zip.js/zip.js 2.6.10 → 2.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ import * as zip from "../../index.js";
2
+
3
+ const FILENAME = "lorem.txt";
4
+
5
+ export { test };
6
+
7
+ async function test() {
8
+ zip.configure({ chunkSize: 128, useWebWorkers: true });
9
+ const zipWriter = new zip.ZipWriter(new zip.BlobWriter("application/zip"));
10
+ try {
11
+ await Promise.all([
12
+ zipWriter.add(FILENAME, new zip.TextReader("")),
13
+ zipWriter.add(FILENAME, new zip.TextReader(""))
14
+ ]);
15
+ } catch (error) {
16
+ if (error.message == zip.ERR_DUPLICATED_NAME) {
17
+ return true;
18
+ }
19
+ } finally {
20
+ await zipWriter.close();
21
+ zip.terminateWorkers();
22
+ }
23
+ throw new Error();
24
+ }
@@ -9,6 +9,7 @@ export default ([
9
9
  { title: "Custom IO classes", script: "./test-custom-io.js" },
10
10
  { title: "Data descriptor signature", script: "./test-data-descriptor-signature.js" },
11
11
  { title: "Data descriptor", script: "./test-data-descriptor.js" },
12
+ { title: "Duplicated Filename", script: "./test-duplicated-filename.js" },
12
13
  { title: "Empty zip file", script: "./test-empty.js" },
13
14
  { title: "Extended timestamp", script: "./test-extended-timestamp.js" },
14
15
  { title: "Extra field", script: "./test-extra-field.js" },