Arjun Barrett il y a 4 ans
Parent
commit
0d87336bf6
5 fichiers modifiés avec 15 ajouts et 4 suppressions
  1. 6 0
      CHANGELOG.md
  2. 3 0
      README.md
  3. 4 2
      demo/components/code-box/index.tsx
  4. 1 1
      package.json
  5. 1 1
      src/index.ts

+ 6 - 0
CHANGELOG.md

@@ -1,3 +1,9 @@
+## 0.4.1
+- Fix ZIP failure bug
+- Make ZIP options work better
+- Improve docs
+- Fix async inflate failure
+- Work on Rust version
 ## 0.3.11
 - Fix docs
 ## 0.3.9

+ 3 - 0
README.md

@@ -115,6 +115,9 @@ const buf = fflate.strToU8('Hello world!');
 
 // The second argument, latin1, is a boolean that indicates that the data
 // is not Unicode but rather should be encoded and decoded as Latin-1.
+// This is useful for creating a string from binary data that isn't
+// necessarily valid UTF-8. However, binary strings are incredibly
+// inefficient and tend to double file size, so they're not recommended.
 const compressedString = fflate.strFromU8(
   fflate.compressSync(buf),
   true

+ 4 - 2
demo/components/code-box/index.tsx

@@ -26,7 +26,8 @@ var filesLengths = {};
 // performance
 var ALREADY_COMPRESSED = [
   'zip', 'gz', 'png', 'jpg', 'jpeg', 'pdf', 'doc', 'docx', 'ppt', 'pptx',
-  'xls', 'xlsx', 'heic', 'heif', '7z', 'bz2', 'rar', 'gif', 'webp', 'webm'
+  'xls', 'xlsx', 'heic', 'heif', '7z', 'bz2', 'rar', 'gif', 'webp', 'webm',
+  'mp4', 'mov', 'mp3', 'aifc'
 ];
 
 // This function binds the variable "file" to the local scope, which makes
@@ -139,7 +140,8 @@ var left = files.length;
 var zipObj = {};
 var ALREADY_COMPRESSED = [
   'zip', 'gz', 'png', 'jpg', 'jpeg', 'pdf', 'doc', 'docx', 'ppt', 'pptx',
-  'xls', 'xlsx', 'heic', 'heif', '7z', 'bz2', 'rar', 'gif', 'webp', 'webm'
+  'xls', 'xlsx', 'heic', 'heif', '7z', 'bz2', 'rar', 'gif', 'webp', 'webm',
+  'mp4', 'mov', 'mp3', 'aifc'
 ];
 
 // Yet again, this is necessary for parallelization.

+ 1 - 1
package.json

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

+ 1 - 1
src/index.ts

@@ -907,7 +907,7 @@ const wrkr = <T, R>(fns: (() => unknown[])[], init: (ev: MessageEvent<T>) => voi
 }
 
 // base async inflate fn
-const bInflt = () => [u8, u16, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, hMap, max, bits, bits16, shft, slc, inflt, inflateSync, pbf, gu8];
+const bInflt = () => [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, hMap, max, bits, bits16, shft, slc, inflt, inflateSync, pbf, gu8];
 const bDflt = () => [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]
 
 // gzip extra