@zip.js/zip.js 2.16.0 → 2.17.0

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.
Files changed (49) hide show
  1. package/deno.json +1 -1
  2. package/dist/zip-core-external.js +429 -274
  3. package/dist/zip-core-external.min.js +1 -1
  4. package/dist/zip-core.js +230 -151
  5. package/dist/zip-core.min.js +1 -1
  6. package/dist/zip-fs-core-external.js +580 -283
  7. package/dist/zip-fs-core-external.min.js +1 -1
  8. package/dist/zip-fs-core.js +383 -160
  9. package/dist/zip-fs-core.min.js +1 -1
  10. package/dist/zip-fs-external.js +580 -283
  11. package/dist/zip-fs-external.min.js +1 -1
  12. package/dist/zip-fs-native.js +386 -163
  13. package/dist/zip-fs-native.min.js +1 -1
  14. package/dist/zip-fs.js +583 -283
  15. package/dist/zip-fs.min.js +1 -1
  16. package/dist/zip-legacy.js +232 -153
  17. package/dist/zip-legacy.min.js +1 -1
  18. package/dist/zip-native.js +233 -154
  19. package/dist/zip-native.min.js +1 -1
  20. package/dist/zip-web-worker-native.js +1 -1
  21. package/dist/zip-web-worker.js +1 -1
  22. package/dist/zip.js +430 -274
  23. package/dist/zip.min.js +1 -1
  24. package/eslint.config.mjs +1 -1
  25. package/index-native.cjs +386 -163
  26. package/index-native.min.js +1 -1
  27. package/index.cjs +583 -283
  28. package/index.d.cts +168 -29
  29. package/index.d.ts +168 -29
  30. package/index.min.js +1 -1
  31. package/lib/core/codec-pool.js +2 -0
  32. package/lib/core/codec-worker-web.js +11 -3
  33. package/lib/core/codec-worker.js +2 -1
  34. package/lib/core/streams/aes-crypto-stream.js +60 -17
  35. package/lib/core/streams/codec-stream.js +2 -0
  36. package/lib/core/streams/zip-crypto-stream.js +7 -7
  37. package/lib/core/streams/zip-entry-stream.js +130 -113
  38. package/lib/core/streams/zlib-js/zlib-streams.min.js +1 -1
  39. package/lib/core/streams/zlib-wasm/zlib-streams.js +199 -122
  40. package/lib/core/util/compatible-streams.js +10 -5
  41. package/lib/core/version.js +1 -1
  42. package/lib/core/web-worker-base.js +1 -1
  43. package/lib/core/web-worker-inline-native.js +1 -1
  44. package/lib/core/web-worker-inline-wasm.js +1 -1
  45. package/lib/core/zip-fs.js +157 -10
  46. package/lib/core/zip-reader.js +8 -5
  47. package/lib/core/zip-writer.js +5 -2
  48. package/lib/zip-core-reader.js +1 -0
  49. package/package.json +3 -2
@@ -1052,9 +1052,11 @@ function resolveMetadata(zipWriter, name, options) {
1052
1052
  const passThrough = checkPassThroughOption(getOptionValue(zipWriter, options, OPTION_PASS_THROUGH));
1053
1053
  const passThroughCompression = Boolean(passThrough);
1054
1054
  const passThroughEncryption = passThrough === true;
1055
- const password = getOptionValue(zipWriter, options, OPTION_PASSWORD);
1056
- const rawPassword = getOptionValue(zipWriter, options, OPTION_RAW_PASSWORD);
1055
+ let password = getOptionValue(zipWriter, options, OPTION_PASSWORD);
1056
+ let rawPassword = getOptionValue(zipWriter, options, OPTION_RAW_PASSWORD);
1057
1057
  checkPasswordOption(password, rawPassword);
1058
+ password = password && password.length ? password : UNDEFINED_VALUE;
1059
+ rawPassword = rawPassword && rawPassword.length ? rawPassword : UNDEFINED_VALUE;
1058
1060
  const encryptionStrength = getNumberOptionValue(zipWriter, options, OPTION_ENCRYPTION_STRENGTH, 3);
1059
1061
  const zipCrypto = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIPCRYPTO);
1060
1062
  const extendedTimestamp = getOptionValue(zipWriter, options, OPTION_EXTENDED_TIMESTAMP, true);
@@ -1671,6 +1673,7 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
1671
1673
  const result = await runWorker({ readable, writable }, workerOptions);
1672
1674
  compressedSize = result.outputSize;
1673
1675
  writer.size += compressedSize;
1676
+ throwIfAborted(signal);
1674
1677
  if (!passThroughCompression) {
1675
1678
  uncompressedSize = result.inputSize;
1676
1679
  if (!encrypted || zipCrypto) {
@@ -46,6 +46,7 @@ export {
46
46
  ERR_INVALID_UNCOMPRESSED_SIZE,
47
47
  ERR_INVALID_PASSWORD,
48
48
  ERR_INVALID_COMPRESSED_DATA,
49
+ ERR_CODEC_OUT_OF_MEMORY,
49
50
  ERR_SPLIT_ZIP_FILE,
50
51
  ERR_OVERLAPPING_ENTRY,
51
52
  ERR_ENTRY_DATA_OUT_OF_BOUNDS,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A JavaScript library to zip and unzip files in the browser, Deno and Node.js",
4
4
  "author": "Gildas Lormeau",
5
5
  "license": "BSD-3-Clause",
6
- "version": "2.16.0",
6
+ "version": "2.17.0",
7
7
  "type": "module",
8
8
  "keywords": [
9
9
  "zip",
@@ -42,7 +42,7 @@
42
42
  "release": "sh ./release.sh",
43
43
  "lint": "npx eslint . && deno lint",
44
44
  "test": "npm run test-ci && npm run test-bun && npm run test-bun-dist",
45
- "test-ci": "npm run test-registration && npm run test-node && npm run test-deno && npm run test-node-dist && npm run test-deno-dist && npm run test-web-streams-polyfill && npm run test-fidelity && npm run test-types && npm run test-api-symmetry && npm run test-api-shape && npm run test-api-mangling && npm run test-api-exports",
45
+ "test-ci": "npm run test-registration && npm run test-node && npm run test-deno && npm run test-node-dist && npm run test-deno-dist && npm run test-web-streams-polyfill && npm run test-deno-polyfill && npm run test-fidelity && npm run test-types && npm run test-api-symmetry && npm run test-api-shape && npm run test-api-mangling && npm run test-api-exports",
46
46
  "test-browsers": "npm run test-chrome && npm run test-firefox && npm run test-safari",
47
47
  "serve-tests": "http-server -p 8888 -c-1 .",
48
48
  "test-all": "npm run lint && npm run test && npm run test-browsers",
@@ -52,6 +52,7 @@
52
52
  "build-doc-markdown": "npx typedoc --plugin typedoc-plugin-markdown --disableSources --out ./docs",
53
53
  "test-deno": "cd ./tests && deno test --allow-read ./deno-runner.js",
54
54
  "test-web-streams-polyfill": "cd ./tests && deno run --allow-read ./web-streams-polyfill-runner.js",
55
+ "test-deno-polyfill": "cd ./tests && deno test --allow-read ./deno-polyfill-runner.js",
55
56
  "test-node": "cd ./tests && node ./node-runner.js",
56
57
  "test-bun": "cd ./tests && bun test ./bun-runner.js",
57
58
  "test-deno-dist": "./tests/dist-runner.sh deno",