Arjun Barrett 4 лет назад
Родитель
Сommit
546dc8efa2
3 измененных файлов с 4 добавлено и 3 удалено
  1. 1 0
      README.md
  2. 1 1
      package.json
  3. 2 2
      src/index.ts

+ 1 - 0
README.md

@@ -15,6 +15,7 @@ In addition to the base decompression and compression APIs, `fflate` supports hi
 | ZIP support               | ❌     | ❌                    | ✅                    | ✅                             |
 | Thread/Worker safe        | ✅     | ✅                    | ❌                    | ✅                             |
 | GZIP/Zlib support         | ✅     | ❌                    | ❌                    | ✅                             |
+| Multi-core/Asynchronous   | ❌     | ❌                    | ❌                    | ✅                             |
 | Uses ES Modules           | ❌     | ❌                    | ❌                    | ✅                             |
 
 ## Usage

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "fflate",
-  "version": "0.2.1",
+  "version": "0.2.2",
   "description": "High performance (de)compression in an 8kB package",
   "main": "lib/index.js",
   "module": "esm/index.js",

+ 2 - 2
src/index.ts

@@ -1274,7 +1274,7 @@ export function zip(data: AsyncZippable, opts: AsyncZipOptions | FlateCallback,
   for (let i = 0; i < slft; ++i) {
     const fn = k[i];
     const [file, p] = r[fn];
-    const c = crc(file);
+    const c = crc(file), m = file.length;
     const n = stu8(fn), s = n.length;
     const t = p.level == 0 ? 0 : 8;
     if (!n) throw 'filename too long';
@@ -1287,7 +1287,7 @@ export function zip(data: AsyncZippable, opts: AsyncZipOptions | FlateCallback,
         files[i] = {
           t,
           d,
-          m: file.length,
+          m,
           c,
           u: fn.length != l,
           n,