blob: d138177f7b730f886f6720a057ae558839eb8e41 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
'use strict';
var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');
var pako = require("pako");
exports.uncompressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
exports.compressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
exports.magic = "\x08\x00";
exports.compress = function(input, compressionOptions) {
return pako.deflateRaw(input, {
level : compressionOptions.level || -1 // default compression
});
};
exports.uncompress = function(input) {
return pako.inflateRaw(input);
};
|