Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function readEntries() {
entryTable = {};
entryList = new Array(mainHeader.diskEntries);
var index = mainHeader.offset;
for (var i = 0; i < entryList.length; i++) {
var tmp = index, entry = new ZipEntry(inBuffer);
entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR);
entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength);
if (entry.header.extraLength) {
entry.extra = inBuffer.slice(tmp, tmp += entry.header.extraLength);
}
if (entry.header.commentLength) entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength);
index += entry.header.entryHeaderSize;
entryList[i] = entry;
entryTable[entry.entryName] = entry;
}
}
function readMainHeader() {
addFile: function(entryName, content, comment, attr) {
var entry = new ZipEntry;
entry.entryName = entryName;
entry.comment = comment || "";
entry.attr = attr || 438;
if (entry.isDirectory && content.length) {}
entry.setData(content);
_zip.setEntry(entry);
},
getEntries: function() {