Skip to content

Commit

Permalink
v0.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
101arrowz committed Dec 14, 2021
1 parent 7317216 commit 9110b06
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.7.2
- Fixed TypeScript typing for errors when using `strictNullChecks`
- Fixed failure to compress files above 64kB with `{ level: 0 }`
- Fixed AMD module definition in UMD build
## 0.7.1
- Removed requirement for `setTimeout`
- Added support for unzip file filters (thanks to [@manucorporat](https://github.com/manucorporat): #67)
Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

### AsyncFlateStreamHandler

Ƭ **AsyncFlateStreamHandler**: (err: [FlateError](interfaces/flateerror.md),data: Uint8Array,final: boolean) => void
Ƭ **AsyncFlateStreamHandler**: (err: [FlateError](interfaces/flateerror.md) \| null,data: Uint8Array,final: boolean) => void

Handler for asynchronous data (de)compression streams

Expand All @@ -121,7 +121,7 @@ ___

### FlateCallback

Ƭ **FlateCallback**: (err: [FlateError](interfaces/flateerror.md),data: Uint8Array) => void
Ƭ **FlateCallback**: (err: [FlateError](interfaces/flateerror.md) \| null,data: Uint8Array) => void

Callback for asynchronous (de)compression methods

Expand Down Expand Up @@ -157,7 +157,7 @@ ___

### UnzipCallback

Ƭ **UnzipCallback**: (err: [FlateError](interfaces/flateerror.md),data: [Unzipped](interfaces/unzipped.md)) => void
Ƭ **UnzipCallback**: (err: [FlateError](interfaces/flateerror.md) \| null,data: [Unzipped](interfaces/unzipped.md)) => void

Callback for asynchronous ZIP decompression

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fflate",
"version": "0.7.1",
"version": "0.7.2",
"description": "High performance (de)compression in an 8kB package",
"main": "./lib/index.cjs",
"module": "./esm/browser.js",
Expand Down
2 changes: 1 addition & 1 deletion scripts/buildUMD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ minify(src, opts).then(async out => {
/exports.__esModule=!0;/,
''
);
const res = "!function(f){typeof module!='undefined'&&typeof exports=='object'?module.exports=f():typeof define!='undefined'&&define.amd?define(['fflate',f]):(typeof self!='undefined'?self:this).fflate=f()}(function(){var _e={};" +
const res = "!function(f){typeof module!='undefined'&&typeof exports=='object'?module.exports=f():typeof define!='undefined'&&define.amd?define(f):(typeof self!='undefined'?self:this).fflate=f()}(function(){var _e={};" +
out.code!.replace(/exports\.(.*) = void 0;\n/, '').replace(/exports\./g, '_e.').replace(/require\("\.\/node-worker\.cjs"\)/,
"(typeof module!='undefined'&&typeof exports=='object'?function(_f){" + nodeWkrOut + 'return _f}:function(_f){' + wkrOut + 'return _f})({})'
) + 'return _e})';
Expand Down
15 changes: 6 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,14 +624,11 @@ const dflt = (dat: Uint8Array, lvl: number, plvl: number, pre: number, post: num
for (let i = 0; i <= s; i += 65535) {
// end
const e = i + 65535;
if (e < s) {
// write full block
pos = wfblk(w, pos, dat.subarray(i, e));
} else {
if (e >= s) {
// write final block
w[i] = lst;
pos = wfblk(w, pos, dat.subarray(i, s));
w[pos >> 3] = lst;
}
pos = wfblk(w, pos + 1, dat.subarray(i, e));
}
} else {
const opt = deo[lvl - 1];
Expand Down Expand Up @@ -844,14 +841,14 @@ export type FlateStreamHandler = (data: Uint8Array, final: boolean) => void;
* @param data The data output from the stream processor
* @param final Whether this is the final block
*/
export type AsyncFlateStreamHandler = (err: FlateError, data: Uint8Array, final: boolean) => void;
export type AsyncFlateStreamHandler = (err: FlateError | null, data: Uint8Array, final: boolean) => void;

/**
* Callback for asynchronous (de)compression methods
* @param err Any error that occurred
* @param data The resulting data. Only present if `err` is null
*/
export type FlateCallback = (err: FlateError, data: Uint8Array) => void;
export type FlateCallback = (err: FlateError | null, data: Uint8Array) => void;

// async callback-based compression
interface AsyncOptions {
Expand Down Expand Up @@ -2087,7 +2084,7 @@ export type StringStreamHandler = (data: string, final: boolean) => void;
* @param err Any error that occurred
* @param data The decompressed ZIP archive
*/
export type UnzipCallback = (err: FlateError, data: Unzipped) => void;
export type UnzipCallback = (err: FlateError | null, data: Unzipped) => void;

/**
* Handler for streaming ZIP decompression
Expand Down

0 comments on commit 9110b06

Please sign in to comment.