mirror of
https://github.com/0x5eal/rbxts-pako.git
synced 2025-04-11 06:10:57 +01:00
raw
option support for wrapper (not works now)
This commit is contained in:
parent
ee4543fc0a
commit
b4c0a04872
2 changed files with 19 additions and 9 deletions
|
@ -25,16 +25,22 @@ var Deflate = function(options) {
|
|||
strategy: c.Z_DEFAULT_STRATEGY
|
||||
}, options || {});
|
||||
|
||||
var opt = this.options;
|
||||
|
||||
if (opt.raw && (opt.windowBits > 0)) {
|
||||
opt.windowBits = -opt.windowBits;
|
||||
}
|
||||
|
||||
this.strm = new zstream();
|
||||
this.strm.next_out = utils.arrayCreate(this.options.chunkSize);
|
||||
this.strm.next_out = utils.arrayCreate(opt.chunkSize);
|
||||
|
||||
var status = zlib_deflate.deflateInit2(
|
||||
this.strm,
|
||||
this.options.level,
|
||||
this.options.method,
|
||||
this.options.windowBits,
|
||||
this.options.memLevel,
|
||||
this.options.strategy
|
||||
opt.level,
|
||||
opt.method,
|
||||
opt.windowBits,
|
||||
opt.memLevel,
|
||||
opt.strategy
|
||||
);
|
||||
|
||||
if (status !== c.Z_OK) {
|
||||
|
|
|
@ -18,13 +18,17 @@ var sample_file = path.join(__dirname, 'fixtures/lorem_100k.txt');
|
|||
var sample = new Uint8Array(fs.readFileSync(sample_file));
|
||||
|
||||
|
||||
describe.skip('Deflate defaults', function () {
|
||||
describe('Deflate defaults', function () {
|
||||
|
||||
it('deflate', function(done) {
|
||||
it.skip('deflate', function(done) {
|
||||
testDeflate(zlib.createDeflate, pako.deflate, sample, {}, done);
|
||||
});
|
||||
|
||||
it('deflate raw', function(done) {
|
||||
it.skip('deflate raw', function(done) {
|
||||
testDeflate(zlib.createDeflateRaw, pako.deflateRaw, sample, {}, done);
|
||||
});
|
||||
|
||||
it.skip('deflate raw (level 0)', function(done) {
|
||||
testDeflate(zlib.createDeflateRaw, pako.deflateRaw, sample, {}, done);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue