mirror of
https://github.com/0x5eal/rbxts-pako.git
synced 2025-05-04 10:33:48 +01:00
Browser files rebuild
This commit is contained in:
parent
e77b84ea95
commit
54a8b34cd9
6 changed files with 185 additions and 105 deletions
80
dist/pako.js
vendored
80
dist/pako.js
vendored
|
@ -1,4 +1,4 @@
|
|||
/* pako 0.2.6 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
/* pako 0.2.7 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
||||
|
@ -18,6 +18,7 @@ var Z_FINISH = 4;
|
|||
|
||||
var Z_OK = 0;
|
||||
var Z_STREAM_END = 1;
|
||||
var Z_SYNC_FLUSH = 2;
|
||||
|
||||
var Z_DEFAULT_COMPRESSION = -1;
|
||||
|
||||
|
@ -47,7 +48,9 @@ var Z_DEFLATED = 8;
|
|||
*
|
||||
* Compressed result, generated by default [[Deflate#onData]]
|
||||
* and [[Deflate#onEnd]] handlers. Filled after you push last chunk
|
||||
* (call [[Deflate#push]] with `Z_FINISH` / `true` param).
|
||||
* (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you
|
||||
* push a chunk with explicit flush (call [[Deflate#push]] with
|
||||
* `Z_SYNC_FLUSH` param).
|
||||
**/
|
||||
|
||||
/**
|
||||
|
@ -171,8 +174,9 @@ var Deflate = function(options) {
|
|||
*
|
||||
* Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
|
||||
* new compressed chunks. Returns `true` on success. The last data block must have
|
||||
* mode Z_FINISH (or `true`). That flush internal pending buffers and call
|
||||
* [[Deflate#onEnd]].
|
||||
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
|
||||
* [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you
|
||||
* can use mode Z_SYNC_FLUSH, keeping the compression context.
|
||||
*
|
||||
* On fail call [[Deflate#onEnd]] with error code and return false.
|
||||
*
|
||||
|
@ -225,7 +229,7 @@ Deflate.prototype.push = function(data, mode) {
|
|||
this.ended = true;
|
||||
return false;
|
||||
}
|
||||
if (strm.avail_out === 0 || (strm.avail_in === 0 && _mode === Z_FINISH)) {
|
||||
if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {
|
||||
if (this.options.to === 'string') {
|
||||
this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
|
||||
} else {
|
||||
|
@ -242,6 +246,13 @@ Deflate.prototype.push = function(data, mode) {
|
|||
return status === Z_OK;
|
||||
}
|
||||
|
||||
// callback interim results if Z_SYNC_FLUSH.
|
||||
if (_mode === Z_SYNC_FLUSH) {
|
||||
this.onEnd(Z_OK);
|
||||
strm.avail_out = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
@ -265,8 +276,9 @@ Deflate.prototype.onData = function(chunk) {
|
|||
* - status (Number): deflate status. 0 (Z_OK) on success,
|
||||
* other if not.
|
||||
*
|
||||
* Called once after you tell deflate that input stream complete
|
||||
* or error happenned. By default - join collected chunks,
|
||||
* Called once after you tell deflate that the input stream is
|
||||
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
|
||||
* or if an error happened. By default - join collected chunks,
|
||||
* free memory and fill `results` / `err` properties.
|
||||
**/
|
||||
Deflate.prototype.onEnd = function(status) {
|
||||
|
@ -363,6 +375,7 @@ exports.Deflate = Deflate;
|
|||
exports.deflate = deflate;
|
||||
exports.deflateRaw = deflateRaw;
|
||||
exports.gzip = gzip;
|
||||
|
||||
},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate.js":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -396,7 +409,9 @@ var toString = Object.prototype.toString;
|
|||
*
|
||||
* Uncompressed result, generated by default [[Inflate#onData]]
|
||||
* and [[Inflate#onEnd]] handlers. Filled after you push last chunk
|
||||
* (call [[Inflate#push]] with `Z_FINISH` / `true` param).
|
||||
* (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you
|
||||
* push a chunk with explicit flush (call [[Inflate#push]] with
|
||||
* `Z_SYNC_FLUSH` param).
|
||||
**/
|
||||
|
||||
/**
|
||||
|
@ -516,8 +531,9 @@ var Inflate = function(options) {
|
|||
*
|
||||
* Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
|
||||
* new output chunks. Returns `true` on success. The last data block must have
|
||||
* mode Z_FINISH (or `true`). That flush internal pending buffers and call
|
||||
* [[Inflate#onEnd]].
|
||||
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
|
||||
* [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you
|
||||
* can use mode Z_SYNC_FLUSH, keeping the decompression context.
|
||||
*
|
||||
* On fail call [[Inflate#onEnd]] with error code and return false.
|
||||
*
|
||||
|
@ -573,7 +589,7 @@ Inflate.prototype.push = function(data, mode) {
|
|||
}
|
||||
|
||||
if (strm.next_out) {
|
||||
if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && _mode === c.Z_FINISH)) {
|
||||
if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {
|
||||
|
||||
if (this.options.to === 'string') {
|
||||
|
||||
|
@ -599,6 +615,7 @@ Inflate.prototype.push = function(data, mode) {
|
|||
if (status === c.Z_STREAM_END) {
|
||||
_mode = c.Z_FINISH;
|
||||
}
|
||||
|
||||
// Finalize on the last chunk.
|
||||
if (_mode === c.Z_FINISH) {
|
||||
status = zlib_inflate.inflateEnd(this.strm);
|
||||
|
@ -607,6 +624,13 @@ Inflate.prototype.push = function(data, mode) {
|
|||
return status === c.Z_OK;
|
||||
}
|
||||
|
||||
// callback interim results if Z_SYNC_FLUSH.
|
||||
if (_mode === c.Z_SYNC_FLUSH) {
|
||||
this.onEnd(c.Z_OK);
|
||||
strm.avail_out = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
@ -630,8 +654,9 @@ Inflate.prototype.onData = function(chunk) {
|
|||
* - status (Number): inflate status. 0 (Z_OK) on success,
|
||||
* other if not.
|
||||
*
|
||||
* Called once after you tell inflate that input stream complete
|
||||
* or error happenned. By default - join collected chunks,
|
||||
* Called either after you tell inflate that the input stream is
|
||||
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
|
||||
* or if an error happened. By default - join collected chunks,
|
||||
* free memory and fill `results` / `err` properties.
|
||||
**/
|
||||
Inflate.prototype.onEnd = function(status) {
|
||||
|
@ -747,7 +772,7 @@ exports.assign = function (obj /*from1, from2, from3, ...*/) {
|
|||
var source = sources.shift();
|
||||
if (!source) { continue; }
|
||||
|
||||
if (typeof(source) !== 'object') {
|
||||
if (typeof source !== 'object') {
|
||||
throw new TypeError(source + 'must be non-object');
|
||||
}
|
||||
|
||||
|
@ -835,6 +860,7 @@ exports.setTyped = function (on) {
|
|||
};
|
||||
|
||||
exports.setTyped(TYPED_OK);
|
||||
|
||||
},{}],4:[function(require,module,exports){
|
||||
// String encode/decode helpers
|
||||
'use strict';
|
||||
|
@ -859,8 +885,8 @@ try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch(__) { STR_APPL
|
|||
// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
|
||||
// because max possible codepoint is 0x10ffff
|
||||
var _utf8len = new utils.Buf8(256);
|
||||
for (var i=0; i<256; i++) {
|
||||
_utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
|
||||
for (var q=0; q<256; q++) {
|
||||
_utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
|
||||
}
|
||||
_utf8len[254]=_utf8len[254]=1; // Invalid sequence start
|
||||
|
||||
|
@ -1030,9 +1056,9 @@ exports.utf8border = function(buf, max) {
|
|||
// Small size is preferable.
|
||||
|
||||
function adler32(adler, buf, len, pos) {
|
||||
var s1 = (adler & 0xffff) |0
|
||||
, s2 = ((adler >>> 16) & 0xffff) |0
|
||||
, n = 0;
|
||||
var s1 = (adler & 0xffff) |0,
|
||||
s2 = ((adler >>> 16) & 0xffff) |0,
|
||||
n = 0;
|
||||
|
||||
while (len !== 0) {
|
||||
// Set limit ~ twice less than 5552, to keep
|
||||
|
@ -1055,6 +1081,7 @@ function adler32(adler, buf, len, pos) {
|
|||
|
||||
|
||||
module.exports = adler32;
|
||||
|
||||
},{}],6:[function(require,module,exports){
|
||||
module.exports = {
|
||||
|
||||
|
@ -1103,6 +1130,7 @@ module.exports = {
|
|||
Z_DEFLATED: 8
|
||||
//Z_NULL: null // Use -1 or null inline, depending on var type
|
||||
};
|
||||
|
||||
},{}],7:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -1131,8 +1159,8 @@ var crcTable = makeTable();
|
|||
|
||||
|
||||
function crc32(crc, buf, len, pos) {
|
||||
var t = crcTable
|
||||
, end = pos + len;
|
||||
var t = crcTable,
|
||||
end = pos + len;
|
||||
|
||||
crc = crc ^ (-1);
|
||||
|
||||
|
@ -1145,6 +1173,7 @@ function crc32(crc, buf, len, pos) {
|
|||
|
||||
|
||||
module.exports = crc32;
|
||||
|
||||
},{}],8:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -2911,6 +2940,7 @@ exports.deflatePending = deflatePending;
|
|||
exports.deflatePrime = deflatePrime;
|
||||
exports.deflateTune = deflateTune;
|
||||
*/
|
||||
|
||||
},{"../utils/common":3,"./adler32":5,"./crc32":7,"./messages":13,"./trees":14}],9:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -2952,6 +2982,7 @@ function GZheader() {
|
|||
}
|
||||
|
||||
module.exports = GZheader;
|
||||
|
||||
},{}],10:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -4783,6 +4814,7 @@ exports.inflateSync = inflateSync;
|
|||
exports.inflateSyncPoint = inflateSyncPoint;
|
||||
exports.inflateUndermine = inflateUndermine;
|
||||
*/
|
||||
|
||||
},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -4982,12 +5014,14 @@ module.exports = function inflate_table(type, lens, lens_index, codes, table, ta
|
|||
if (type === CODES) {
|
||||
base = extra = work; /* dummy value--not used */
|
||||
end = 19;
|
||||
|
||||
} else if (type === LENS) {
|
||||
base = lbase;
|
||||
base_index -= 257;
|
||||
extra = lext;
|
||||
extra_index -= 257;
|
||||
end = 256;
|
||||
|
||||
} else { /* DISTS */
|
||||
base = dbase;
|
||||
extra = dext;
|
||||
|
@ -5124,6 +5158,7 @@ module.exports = {
|
|||
'-5': 'buffer error', /* Z_BUF_ERROR (-5) */
|
||||
'-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
|
||||
};
|
||||
|
||||
},{}],14:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -6324,6 +6359,7 @@ exports._tr_stored_block = _tr_stored_block;
|
|||
exports._tr_flush_block = _tr_flush_block;
|
||||
exports._tr_tally = _tr_tally;
|
||||
exports._tr_align = _tr_align;
|
||||
|
||||
},{"../utils/common":3}],15:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -6354,6 +6390,7 @@ function ZStream() {
|
|||
}
|
||||
|
||||
module.exports = ZStream;
|
||||
|
||||
},{}],"/":[function(require,module,exports){
|
||||
// Top level file is just a mixin of submodules & constants
|
||||
'use strict';
|
||||
|
@ -6369,5 +6406,6 @@ var pako = {};
|
|||
assign(pako, deflate, inflate, constants);
|
||||
|
||||
module.exports = pako;
|
||||
|
||||
},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")
|
||||
});
|
6
dist/pako.min.js
vendored
6
dist/pako.min.js
vendored
File diff suppressed because one or more lines are too long
50
dist/pako_deflate.js
vendored
50
dist/pako_deflate.js
vendored
|
@ -1,4 +1,4 @@
|
|||
/* pako 0.2.6 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
/* pako 0.2.7 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ exports.assign = function (obj /*from1, from2, from3, ...*/) {
|
|||
var source = sources.shift();
|
||||
if (!source) { continue; }
|
||||
|
||||
if (typeof(source) !== 'object') {
|
||||
if (typeof source !== 'object') {
|
||||
throw new TypeError(source + 'must be non-object');
|
||||
}
|
||||
|
||||
|
@ -101,6 +101,7 @@ exports.setTyped = function (on) {
|
|||
};
|
||||
|
||||
exports.setTyped(TYPED_OK);
|
||||
|
||||
},{}],2:[function(require,module,exports){
|
||||
// String encode/decode helpers
|
||||
'use strict';
|
||||
|
@ -125,8 +126,8 @@ try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch(__) { STR_APPL
|
|||
// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
|
||||
// because max possible codepoint is 0x10ffff
|
||||
var _utf8len = new utils.Buf8(256);
|
||||
for (var i=0; i<256; i++) {
|
||||
_utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
|
||||
for (var q=0; q<256; q++) {
|
||||
_utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
|
||||
}
|
||||
_utf8len[254]=_utf8len[254]=1; // Invalid sequence start
|
||||
|
||||
|
@ -296,9 +297,9 @@ exports.utf8border = function(buf, max) {
|
|||
// Small size is preferable.
|
||||
|
||||
function adler32(adler, buf, len, pos) {
|
||||
var s1 = (adler & 0xffff) |0
|
||||
, s2 = ((adler >>> 16) & 0xffff) |0
|
||||
, n = 0;
|
||||
var s1 = (adler & 0xffff) |0,
|
||||
s2 = ((adler >>> 16) & 0xffff) |0,
|
||||
n = 0;
|
||||
|
||||
while (len !== 0) {
|
||||
// Set limit ~ twice less than 5552, to keep
|
||||
|
@ -321,6 +322,7 @@ function adler32(adler, buf, len, pos) {
|
|||
|
||||
|
||||
module.exports = adler32;
|
||||
|
||||
},{}],4:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -349,8 +351,8 @@ var crcTable = makeTable();
|
|||
|
||||
|
||||
function crc32(crc, buf, len, pos) {
|
||||
var t = crcTable
|
||||
, end = pos + len;
|
||||
var t = crcTable,
|
||||
end = pos + len;
|
||||
|
||||
crc = crc ^ (-1);
|
||||
|
||||
|
@ -363,6 +365,7 @@ function crc32(crc, buf, len, pos) {
|
|||
|
||||
|
||||
module.exports = crc32;
|
||||
|
||||
},{}],5:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -2129,6 +2132,7 @@ exports.deflatePending = deflatePending;
|
|||
exports.deflatePrime = deflatePrime;
|
||||
exports.deflateTune = deflateTune;
|
||||
*/
|
||||
|
||||
},{"../utils/common":1,"./adler32":3,"./crc32":4,"./messages":6,"./trees":7}],6:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -2143,6 +2147,7 @@ module.exports = {
|
|||
'-5': 'buffer error', /* Z_BUF_ERROR (-5) */
|
||||
'-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
|
||||
};
|
||||
|
||||
},{}],7:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -3343,6 +3348,7 @@ exports._tr_stored_block = _tr_stored_block;
|
|||
exports._tr_flush_block = _tr_flush_block;
|
||||
exports._tr_tally = _tr_tally;
|
||||
exports._tr_align = _tr_align;
|
||||
|
||||
},{"../utils/common":1}],8:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -3373,6 +3379,7 @@ function ZStream() {
|
|||
}
|
||||
|
||||
module.exports = ZStream;
|
||||
|
||||
},{}],"/lib/deflate.js":[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -3393,6 +3400,7 @@ var Z_FINISH = 4;
|
|||
|
||||
var Z_OK = 0;
|
||||
var Z_STREAM_END = 1;
|
||||
var Z_SYNC_FLUSH = 2;
|
||||
|
||||
var Z_DEFAULT_COMPRESSION = -1;
|
||||
|
||||
|
@ -3422,7 +3430,9 @@ var Z_DEFLATED = 8;
|
|||
*
|
||||
* Compressed result, generated by default [[Deflate#onData]]
|
||||
* and [[Deflate#onEnd]] handlers. Filled after you push last chunk
|
||||
* (call [[Deflate#push]] with `Z_FINISH` / `true` param).
|
||||
* (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you
|
||||
* push a chunk with explicit flush (call [[Deflate#push]] with
|
||||
* `Z_SYNC_FLUSH` param).
|
||||
**/
|
||||
|
||||
/**
|
||||
|
@ -3546,8 +3556,9 @@ var Deflate = function(options) {
|
|||
*
|
||||
* Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
|
||||
* new compressed chunks. Returns `true` on success. The last data block must have
|
||||
* mode Z_FINISH (or `true`). That flush internal pending buffers and call
|
||||
* [[Deflate#onEnd]].
|
||||
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
|
||||
* [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you
|
||||
* can use mode Z_SYNC_FLUSH, keeping the compression context.
|
||||
*
|
||||
* On fail call [[Deflate#onEnd]] with error code and return false.
|
||||
*
|
||||
|
@ -3600,7 +3611,7 @@ Deflate.prototype.push = function(data, mode) {
|
|||
this.ended = true;
|
||||
return false;
|
||||
}
|
||||
if (strm.avail_out === 0 || (strm.avail_in === 0 && _mode === Z_FINISH)) {
|
||||
if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {
|
||||
if (this.options.to === 'string') {
|
||||
this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
|
||||
} else {
|
||||
|
@ -3617,6 +3628,13 @@ Deflate.prototype.push = function(data, mode) {
|
|||
return status === Z_OK;
|
||||
}
|
||||
|
||||
// callback interim results if Z_SYNC_FLUSH.
|
||||
if (_mode === Z_SYNC_FLUSH) {
|
||||
this.onEnd(Z_OK);
|
||||
strm.avail_out = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
@ -3640,8 +3658,9 @@ Deflate.prototype.onData = function(chunk) {
|
|||
* - status (Number): deflate status. 0 (Z_OK) on success,
|
||||
* other if not.
|
||||
*
|
||||
* Called once after you tell deflate that input stream complete
|
||||
* or error happenned. By default - join collected chunks,
|
||||
* Called once after you tell deflate that the input stream is
|
||||
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
|
||||
* or if an error happened. By default - join collected chunks,
|
||||
* free memory and fill `results` / `err` properties.
|
||||
**/
|
||||
Deflate.prototype.onEnd = function(status) {
|
||||
|
@ -3738,5 +3757,6 @@ exports.Deflate = Deflate;
|
|||
exports.deflate = deflate;
|
||||
exports.deflateRaw = deflateRaw;
|
||||
exports.gzip = gzip;
|
||||
|
||||
},{"./utils/common":1,"./utils/strings":2,"./zlib/deflate.js":5,"./zlib/messages":6,"./zlib/zstream":8}]},{},[])("/lib/deflate.js")
|
||||
});
|
4
dist/pako_deflate.min.js
vendored
4
dist/pako_deflate.min.js
vendored
File diff suppressed because one or more lines are too long
52
dist/pako_inflate.js
vendored
52
dist/pako_inflate.js
vendored
|
@ -1,4 +1,4 @@
|
|||
/* pako 0.2.6 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
/* pako 0.2.7 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ exports.assign = function (obj /*from1, from2, from3, ...*/) {
|
|||
var source = sources.shift();
|
||||
if (!source) { continue; }
|
||||
|
||||
if (typeof(source) !== 'object') {
|
||||
if (typeof source !== 'object') {
|
||||
throw new TypeError(source + 'must be non-object');
|
||||
}
|
||||
|
||||
|
@ -101,6 +101,7 @@ exports.setTyped = function (on) {
|
|||
};
|
||||
|
||||
exports.setTyped(TYPED_OK);
|
||||
|
||||
},{}],2:[function(require,module,exports){
|
||||
// String encode/decode helpers
|
||||
'use strict';
|
||||
|
@ -125,8 +126,8 @@ try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch(__) { STR_APPL
|
|||
// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
|
||||
// because max possible codepoint is 0x10ffff
|
||||
var _utf8len = new utils.Buf8(256);
|
||||
for (var i=0; i<256; i++) {
|
||||
_utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
|
||||
for (var q=0; q<256; q++) {
|
||||
_utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
|
||||
}
|
||||
_utf8len[254]=_utf8len[254]=1; // Invalid sequence start
|
||||
|
||||
|
@ -296,9 +297,9 @@ exports.utf8border = function(buf, max) {
|
|||
// Small size is preferable.
|
||||
|
||||
function adler32(adler, buf, len, pos) {
|
||||
var s1 = (adler & 0xffff) |0
|
||||
, s2 = ((adler >>> 16) & 0xffff) |0
|
||||
, n = 0;
|
||||
var s1 = (adler & 0xffff) |0,
|
||||
s2 = ((adler >>> 16) & 0xffff) |0,
|
||||
n = 0;
|
||||
|
||||
while (len !== 0) {
|
||||
// Set limit ~ twice less than 5552, to keep
|
||||
|
@ -321,6 +322,7 @@ function adler32(adler, buf, len, pos) {
|
|||
|
||||
|
||||
module.exports = adler32;
|
||||
|
||||
},{}],4:[function(require,module,exports){
|
||||
module.exports = {
|
||||
|
||||
|
@ -369,6 +371,7 @@ module.exports = {
|
|||
Z_DEFLATED: 8
|
||||
//Z_NULL: null // Use -1 or null inline, depending on var type
|
||||
};
|
||||
|
||||
},{}],5:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -397,8 +400,8 @@ var crcTable = makeTable();
|
|||
|
||||
|
||||
function crc32(crc, buf, len, pos) {
|
||||
var t = crcTable
|
||||
, end = pos + len;
|
||||
var t = crcTable,
|
||||
end = pos + len;
|
||||
|
||||
crc = crc ^ (-1);
|
||||
|
||||
|
@ -411,6 +414,7 @@ function crc32(crc, buf, len, pos) {
|
|||
|
||||
|
||||
module.exports = crc32;
|
||||
|
||||
},{}],6:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -452,6 +456,7 @@ function GZheader() {
|
|||
}
|
||||
|
||||
module.exports = GZheader;
|
||||
|
||||
},{}],7:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -2283,6 +2288,7 @@ exports.inflateSync = inflateSync;
|
|||
exports.inflateSyncPoint = inflateSyncPoint;
|
||||
exports.inflateUndermine = inflateUndermine;
|
||||
*/
|
||||
|
||||
},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -2482,12 +2488,14 @@ module.exports = function inflate_table(type, lens, lens_index, codes, table, ta
|
|||
if (type === CODES) {
|
||||
base = extra = work; /* dummy value--not used */
|
||||
end = 19;
|
||||
|
||||
} else if (type === LENS) {
|
||||
base = lbase;
|
||||
base_index -= 257;
|
||||
extra = lext;
|
||||
extra_index -= 257;
|
||||
end = 256;
|
||||
|
||||
} else { /* DISTS */
|
||||
base = dbase;
|
||||
extra = dext;
|
||||
|
@ -2624,6 +2632,7 @@ module.exports = {
|
|||
'-5': 'buffer error', /* Z_BUF_ERROR (-5) */
|
||||
'-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
|
||||
};
|
||||
|
||||
},{}],11:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -2654,6 +2663,7 @@ function ZStream() {
|
|||
}
|
||||
|
||||
module.exports = ZStream;
|
||||
|
||||
},{}],"/lib/inflate.js":[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
@ -2687,7 +2697,9 @@ var toString = Object.prototype.toString;
|
|||
*
|
||||
* Uncompressed result, generated by default [[Inflate#onData]]
|
||||
* and [[Inflate#onEnd]] handlers. Filled after you push last chunk
|
||||
* (call [[Inflate#push]] with `Z_FINISH` / `true` param).
|
||||
* (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you
|
||||
* push a chunk with explicit flush (call [[Inflate#push]] with
|
||||
* `Z_SYNC_FLUSH` param).
|
||||
**/
|
||||
|
||||
/**
|
||||
|
@ -2807,8 +2819,9 @@ var Inflate = function(options) {
|
|||
*
|
||||
* Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
|
||||
* new output chunks. Returns `true` on success. The last data block must have
|
||||
* mode Z_FINISH (or `true`). That flush internal pending buffers and call
|
||||
* [[Inflate#onEnd]].
|
||||
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
|
||||
* [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you
|
||||
* can use mode Z_SYNC_FLUSH, keeping the decompression context.
|
||||
*
|
||||
* On fail call [[Inflate#onEnd]] with error code and return false.
|
||||
*
|
||||
|
@ -2864,7 +2877,7 @@ Inflate.prototype.push = function(data, mode) {
|
|||
}
|
||||
|
||||
if (strm.next_out) {
|
||||
if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && _mode === c.Z_FINISH)) {
|
||||
if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {
|
||||
|
||||
if (this.options.to === 'string') {
|
||||
|
||||
|
@ -2890,6 +2903,7 @@ Inflate.prototype.push = function(data, mode) {
|
|||
if (status === c.Z_STREAM_END) {
|
||||
_mode = c.Z_FINISH;
|
||||
}
|
||||
|
||||
// Finalize on the last chunk.
|
||||
if (_mode === c.Z_FINISH) {
|
||||
status = zlib_inflate.inflateEnd(this.strm);
|
||||
|
@ -2898,6 +2912,13 @@ Inflate.prototype.push = function(data, mode) {
|
|||
return status === c.Z_OK;
|
||||
}
|
||||
|
||||
// callback interim results if Z_SYNC_FLUSH.
|
||||
if (_mode === c.Z_SYNC_FLUSH) {
|
||||
this.onEnd(c.Z_OK);
|
||||
strm.avail_out = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
@ -2921,8 +2942,9 @@ Inflate.prototype.onData = function(chunk) {
|
|||
* - status (Number): inflate status. 0 (Z_OK) on success,
|
||||
* other if not.
|
||||
*
|
||||
* Called once after you tell inflate that input stream complete
|
||||
* or error happenned. By default - join collected chunks,
|
||||
* Called either after you tell inflate that the input stream is
|
||||
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
|
||||
* or if an error happened. By default - join collected chunks,
|
||||
* free memory and fill `results` / `err` properties.
|
||||
**/
|
||||
Inflate.prototype.onEnd = function(status) {
|
||||
|
|
4
dist/pako_inflate.min.js
vendored
4
dist/pako_inflate.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue