Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (async && callback) callback(getCompressedDataFromZip());
return getCompressedDataFromZip();
}
if (uncompressedData.length && !_isDirectory) {
var compressedData;
switch (_entryHeader.method) {
case Utils.Constants.STORED:
_entryHeader.compressedSize = _entryHeader.size;
compressedData = new Buffer(uncompressedData.length);
uncompressedData.copy(compressedData);
if (async && callback) callback(compressedData);
return compressedData;
break;
default:
case Utils.Constants.DEFLATED:
var deflater = new Methods.Deflater(uncompressedData);
if (!async) {
var deflated = deflater.deflate();
_entryHeader.compressedSize = deflated.length;
return deflated;
} else {
deflater.deflateAsync(function(data) {
compressedData = new Buffer(data.length);
_entryHeader.compressedSize = data.length;
data.copy(compressedData);
callback && callback(compressedData);
});
}
deflater = null;
break;
}
} else {