Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var inherits = require('util').inherits;
var Writable = require('stream').Writable;
var ZipArchiveOutputStream = require('compress-commons').ZipArchiveOutputStream;
var cryptoRandomString = require('crypto-random-string');
var CRC32Stream = require('crc32-stream').CRC32Stream;
var DeflateCRC32Stream = require('crc32-stream').DeflateCRC32Stream;
var constants = require('compress-commons/lib/archivers/zip/constants');
var ZipCrypto = require('./zip-crypto');
var ZipStream = require('zip-stream');
var ZipCryptoStream = (module.exports = function(options) {
if (!(this instanceof ZipCryptoStream)) {
return new ZipCryptoStream(options);
}
options = this.options = options || {};
options.zlib = options.zlib || {};
/**
* ZipStream
*
* @ignore
* @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE}
* @copyright (c) 2014 Chris Talkington, contributors.
*/
var inherits = require('util').inherits;
var ZipArchiveOutputStream = require('compress-commons').ZipArchiveOutputStream;
var ZipArchiveEntry = require('compress-commons').ZipArchiveEntry;
var util = require('archiver-utils');
/**
* @constructor
* @extends external:ZipArchiveOutputStream
* @param {Object} [options]
* @param {String} [options.comment] Sets the zip archive comment.
* @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
* @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers.
* @param {Boolean} [options.store=false] Sets the compression method to STORE.
* @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
* to control compression.
*/
var ZipStream = module.exports = function(options) {