@ai-ecoverse/wasm-zip 3.0.0-6 → 3.0.0-7

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.
package/README.md CHANGED
@@ -13,6 +13,10 @@ unzip -l out.zip
13
13
  command, so it needs one (`@ai-ecoverse/wasm-bash`).
14
14
  - Non-ASCII names are UTF-8. `zip` sets the UTF-8 flag on them, and `unzip`
15
15
  shows them and reads Info-ZIP's Unicode path field.
16
+ - The realm's file names are UTF-8. An entry whose name isn't (an old
17
+ Latin-1 or CP437 archive without a Unicode path) is not extracted under a
18
+ changed name: `unzip` says `cannot create <name>` / `Illegal byte sequence`
19
+ and exits 50. `unzip -p` still streams its bytes.
16
20
  - `zip - … > file` and `zip - … | …` write valid archives, and `zip -s 0`
17
21
  merges split archives (`zip -s 1m`) back with every byte.
18
22
  - `zipinfo` is unzip's zipinfo mode, the same as `unzip -Z`.
package/bin/unzip CHANGED
@@ -4557,6 +4557,20 @@ async function createWasm() {
4557
4557
  var FS_createDevice = (...args) => FS.createDevice(...args);
4558
4558
 
4559
4559
 
4560
+ {
4561
+ const lenient = SYSCALLS.getStr;
4562
+ const strict = new TextDecoder('utf-8', { fatal: true });
4563
+ SYSCALLS.getStr = (ptr) => {
4564
+ let end = ptr;
4565
+ while (HEAPU8[end]) end++;
4566
+ try {
4567
+ strict.decode(HEAPU8.subarray(ptr, end));
4568
+ } catch {
4569
+ throw new FS.ErrnoError(25);
4570
+ }
4571
+ return lenient(ptr);
4572
+ };
4573
+ };
4560
4574
 
4561
4575
  FS.createPreloadedFile = FS_createPreloadedFile;
4562
4576
  FS.preloadFile = FS_preloadFile;
package/bin/unzip.wasm CHANGED
Binary file
package/bin/zip CHANGED
@@ -4844,6 +4844,20 @@ async function createWasm() {
4844
4844
  var FS_createDevice = (...args) => FS.createDevice(...args);
4845
4845
 
4846
4846
 
4847
+ {
4848
+ const lenient = SYSCALLS.getStr;
4849
+ const strict = new TextDecoder('utf-8', { fatal: true });
4850
+ SYSCALLS.getStr = (ptr) => {
4851
+ let end = ptr;
4852
+ while (HEAPU8[end]) end++;
4853
+ try {
4854
+ strict.decode(HEAPU8.subarray(ptr, end));
4855
+ } catch {
4856
+ throw new FS.ErrnoError(25);
4857
+ }
4858
+ return lenient(ptr);
4859
+ };
4860
+ };
4847
4861
 
4848
4862
  FS.createPreloadedFile = FS_createPreloadedFile;
4849
4863
  FS.preloadFile = FS_preloadFile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/wasm-zip",
3
- "version": "3.0.0-6",
3
+ "version": "3.0.0-7",
4
4
  "description": "Info-ZIP zip 3.0 + unzip 6.0 for wasm / slicc (emscripten)",
5
5
  "license": "Info-ZIP",
6
6
  "repository": {