Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fd: fd,
// shift the start and end offsets
start: start + offsetArg,
end: end + offsetArg - 1, // the -1 is because fs.createReadStream()'s end option is inclusive
autoClose: false
})
}
MiddleOfFileReader.prototype.read = function (buffer, offset, length, position, callback) {
// shift the position
fs.read(fd, buffer, offset, length, position + offsetArg, callback)
}
MiddleOfFileReader.prototype.close = function (callback) {
fs.close(fd, callback)
}
yauzl.fromRandomAccessReader(new MiddleOfFileReader(), endArg - offsetArg, options, handleZipFile)
})
})