tiny-inflate
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -350,3 +350,10 @@ var TINF_OK = 0; | ||
return d.dest.slice(0, d.destLen); | ||
if (d.destLen < d.dest.length) { | ||
if (typeof d.dest.slice === 'function') | ||
return d.dest.slice(0, d.destLen); | ||
else | ||
return d.dest.subarray(0, d.destLen); | ||
} | ||
return d.dest; | ||
} | ||
@@ -353,0 +360,0 @@ |
{ | ||
"name": "tiny-inflate", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A tiny inflate implementation", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -63,3 +63,3 @@ var inflate = require('../'); | ||
it('should handle uncompressed blocks', function() { | ||
it('should handle fixed huffman blocks', function() { | ||
var out = new Buffer(uncompressed.length); | ||
@@ -69,2 +69,9 @@ inflate(fixed, out); | ||
}); | ||
it('should handle typed arrays', function() { | ||
var input = new Uint8Array(compressed); | ||
var out = new Uint8Array(uncompressed.length); | ||
inflate(input, out); | ||
assert.deepEqual(out, new Uint8Array(uncompressed)); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41932
358