Skip to content

Commit

Permalink
option "trailingSpace"
Browse files Browse the repository at this point in the history
  • Loading branch information
5saviahv committed Jun 23, 2024
1 parent 0a357a9 commit c5222b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zipFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ module.exports = function (/*Buffer|null*/ inBuffer, /** object */ options) {
endOffset = -1, // Start offset of the END header
commentEnd = 0;

// option to search header form entire file
const trailingSpace = typeof opts.trailingSpace === "boolean" ? opts.trailingSpace : false;
if (trailingSpace) max = 0;

for (i; i >= n; i--) {
if (inBuffer[i] !== 0x50) continue; // quick check that the byte is 'P'
if (inBuffer.readUInt32LE(i) === Utils.Constants.ENDSIG) {
Expand Down

0 comments on commit c5222b4

Please sign in to comment.