Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var ZipCryptoStream = (module.exports = function(options) {
if (!(this instanceof ZipCryptoStream)) {
return new ZipCryptoStream(options);
}
options = this.options = options || {};
options.zlib = options.zlib || {};
ZipArchiveOutputStream.call(this, options);
if (typeof options.level === 'number' && options.level >= 0) {
options.zlib.level = options.level;
delete options.level;
}
if (typeof options.zlib.level === 'number' && options.zlib.level === 0) {
options.store = true;
}
if (options.comment && options.comment.length > 0) {
this.setComment(options.comment);
}
});
var ZipStream = module.exports = function(options) {
if (!(this instanceof ZipStream)) {
return new ZipStream(options);
}
options = this.options = options || {};
options.zlib = options.zlib || {};
ZipArchiveOutputStream.call(this, options);
if (typeof options.level === 'number' && options.level >= 0) {
options.zlib.level = options.level;
delete options.level;
}
if (!options.forceZip64 && typeof options.zlib.level === 'number' && options.zlib.level === 0) {
options.store = true;
}
if (options.comment && options.comment.length > 0) {
this.setComment(options.comment);
}
};