Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
if (this.opts.gzip) {
// we're in gzipped mode - GZip the buffer
recordBuffer = zlib.gzipSync(recordBuffer)
}
if (!this._warcOutStream.write(recordBuffer, 'utf8')) {
this._warcOutStream.once('drain', resolve)
} else {
resolve()
}
})
}
_save(target, content) {
const compressed = zlib.gzipSync(content)
fs.writeFileSync(target + '.gz', compressed)
}
}