flate.js 503 B

1234567891011121314
  1. 'use strict';
  2. var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');
  3. var pako = require("pako");
  4. exports.uncompressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
  5. exports.compressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
  6. exports.magic = "\x08\x00";
  7. exports.compress = function(input) {
  8. return pako.deflateRaw(input);
  9. };
  10. exports.uncompress = function(input) {
  11. return pako.inflateRaw(input);
  12. };