🗑 Remove debug message

This commit is contained in:
C-3PO 2018-07-04 19:57:55 +02:00
parent c821327a6e
commit a3bff814ef
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
3 changed files with 6 additions and 5 deletions

View file

@ -13,8 +13,9 @@ export default function getUrlContents({ host, path }: {host: string, path: stri
//In case of connection errors, exit early //In case of connection errors, exit early
request.on('error', (error) => { request.on('error', (error) => {
request.abort(); request.abort();
return reject(error); reject(error);
}); });
request.end(); request.end();
}); });
} }

View file

@ -31,7 +31,6 @@ export default async function extractFile(file: ISsnFileEntry, dvArray: DataView
//Decompress file //Decompress file
const decompressedBuffer: Buffer = await new Promise((resolve, reject) => { const decompressedBuffer: Buffer = await new Promise((resolve, reject) => {
console.log(new Uint8Array(dvFinal.buffer));
zlib.inflateRaw(dvFinal, (error, result) => { zlib.inflateRaw(dvFinal, (error, result) => {
if (error !== null) { if (error !== null) {
return reject(error); return reject(error);
@ -39,5 +38,6 @@ export default async function extractFile(file: ISsnFileEntry, dvArray: DataView
resolve(result); resolve(result);
}); });
}) as Buffer; }) as Buffer;
return decompressedBuffer.buffer as ArrayBuffer; return decompressedBuffer.buffer as ArrayBuffer;
} }

View file

@ -91,8 +91,8 @@ export default function readSsnFile(buffer: ArrayBuffer): ISsnFileEntry[] {
const fileCrc = dv.getUint32(pos, true); pos += 4; const fileCrc = dv.getUint32(pos, true); pos += 4;
/** compressed size */ /** compressed size */
const comprSize = dv.getUint32(pos, true); pos += 4; const comprSize = dv.getUint32(pos, true); pos += 4;
/** uncompressed size */ /** decompressed size */
const uncomprSize = dv.getUint32(pos, true); pos += 4; const decomprSize = dv.getUint32(pos, true); pos += 4;
/** file name length */ /** file name length */
const fileNameLength = dv.getUint16(pos, true); pos += 2; const fileNameLength = dv.getUint16(pos, true); pos += 2;
/** extra field length */ /** extra field length */
@ -158,7 +158,7 @@ export default function readSsnFile(buffer: ArrayBuffer): ISsnFileEntry[] {
offset: (centralDirOffset > 0) ? //If files are included in this archive, the centralDirOffset will not start from the beginning offset: (centralDirOffset > 0) ? //If files are included in this archive, the centralDirOffset will not start from the beginning
posCentralDirStart - centralDirOffset + relOffset : //if file is in this archive posCentralDirStart - centralDirOffset + relOffset : //if file is in this archive
relOffset, //if we need to look in a disk (e.g. .z01 for this file) relOffset, //if we need to look in a disk (e.g. .z01 for this file)
size: uncomprSize, size: decomprSize,
}; };
//If file is encrypted //If file is encrypted