Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const ZipCryptoStream = function (options = {zlib: {}}) {
if (!(this instanceof ZipCryptoStream)) {
return new ZipCryptoStream(options);
}
this.key = options.password;
if (!Buffer.isBuffer(this.key)) {
this.key = Buffer.from(options.password);
}
ZipStream.call(this, options);
};
inherits(ZipCryptoStream, ZipStream);
const ZipAesStream = function (options = {zlib: {}}) {
if (!(this instanceof ZipAesStream)) {
return new ZipAesStream(options);
}
this.key = options.password;
if (!Buffer.isBuffer(this.key)) {
this.key = Buffer.from(this.key);
}
ZipStream.call(this, options);
};
inherits(ZipAesStream, ZipStream);