Skip to content

Commit

Permalink
bump up version
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas-lormeau committed Jan 31, 2025
1 parent 99d5748 commit b608211
Show file tree
Hide file tree
Showing 14 changed files with 194 additions and 99 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zip-js/zip-js",
"version": "2.7.56",
"version": "2.7.57",
"exports": {
".": "./index.js",
"./data-uri": "./lib/zip-data-uri.js"
Expand Down
55 changes: 37 additions & 18 deletions dist/zip-fs-full.js
Original file line number Diff line number Diff line change
Expand Up @@ -4284,6 +4284,7 @@
const FILE_ATTR_MSDOS_DIR_MASK = 0x10;
const FILE_ATTR_UNIX_DIR_MASK = 0x4000;
const FILE_ATTR_UNIX_EXECUTABLE_MASK = 0o111;
const FILE_ATTR_UNIX_DEFAULT_MASK = 0o644;

const VERSION_DEFLATE = 0x14;
const VERSION_ZIP64 = 0x2D;
Expand Down Expand Up @@ -9223,12 +9224,14 @@
const PROPERTY_NAME_VERSION = "version";
const PROPERTY_NAME_VERSION_MADE_BY = "versionMadeBy";
const PROPERTY_NAME_ZIPCRYPTO = "zipCrypto";
const PROPERTY_NAME_DIRECTORY = "directory";
const PROPERTY_NAME_EXECUTABLE = "executable";

const PROPERTY_NAMES = [
PROPERTY_NAME_FILENAME, PROPERTY_NAME_RAW_FILENAME, PROPERTY_NAME_COMPPRESSED_SIZE, PROPERTY_NAME_UNCOMPPRESSED_SIZE,
PROPERTY_NAME_LAST_MODIFICATION_DATE, PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE, PROPERTY_NAME_COMMENT, PROPERTY_NAME_RAW_COMMENT,
PROPERTY_NAME_LAST_ACCESS_DATE, PROPERTY_NAME_CREATION_DATE, PROPERTY_NAME_OFFSET, PROPERTY_NAME_DISK_NUMBER_START,
PROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY, PROPERTY_NAME_ZIPCRYPTO, "directory", "executable", "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];
PROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY, PROPERTY_NAME_ZIPCRYPTO, PROPERTY_NAME_DIRECTORY, PROPERTY_NAME_EXECUTABLE, "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];

class Entry {

Expand Down Expand Up @@ -10073,10 +10076,37 @@

async function addFile(zipWriter, name, reader, options) {
name = name.trim();
if (options.directory && (!name.endsWith(DIRECTORY_SIGNATURE))) {
name += DIRECTORY_SIGNATURE;
} else {
options.directory = name.endsWith(DIRECTORY_SIGNATURE);
const msDosCompatible = getOptionValue(zipWriter, options, PROPERTY_NAME_MS_DOS_COMPATIBLE);
const versionMadeBy = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION_MADE_BY, msDosCompatible ? 20 : 768);
const executable = getOptionValue(zipWriter, options, PROPERTY_NAME_EXECUTABLE);
if (versionMadeBy > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
let externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, 0);
if (externalFileAttributes === 0) {
externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, 0);
}
if (!options.directory && name.endsWith(DIRECTORY_SIGNATURE)) {
options.directory = true;
}
const directory = getOptionValue(zipWriter, options, PROPERTY_NAME_DIRECTORY);
if (directory) {
if (!name.endsWith(DIRECTORY_SIGNATURE)) {
name += DIRECTORY_SIGNATURE;
}
if (externalFileAttributes === 0) {
if (msDosCompatible) {
externalFileAttributes = FILE_ATTR_MSDOS_DIR_MASK;
} else {
externalFileAttributes = FILE_ATTR_UNIX_DIR_MASK << 16;
}
}
} else if (!msDosCompatible && externalFileAttributes === 0) {
if (executable) {
externalFileAttributes = (FILE_ATTR_UNIX_EXECUTABLE_MASK | FILE_ATTR_UNIX_DEFAULT_MASK) << 16;
} else {
externalFileAttributes = FILE_ATTR_UNIX_DEFAULT_MASK << 16;
}
}
const encode = getOptionValue(zipWriter, options, "encodeText", encodeText);
let rawFilename = encode(name);
Expand All @@ -10098,22 +10128,13 @@
if (version > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
const versionMadeBy = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION_MADE_BY, 20);
if (versionMadeBy > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
const lastModDate = getOptionValue(zipWriter, options, PROPERTY_NAME_LAST_MODIFICATION_DATE, new Date());
const lastAccessDate = getOptionValue(zipWriter, options, PROPERTY_NAME_LAST_ACCESS_DATE);
const creationDate = getOptionValue(zipWriter, options, PROPERTY_NAME_CREATION_DATE);
const msDosCompatible = getOptionValue(zipWriter, options, PROPERTY_NAME_MS_DOS_COMPATIBLE, true);
let internalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, 0);
if (internalFileAttributes === 0) {
internalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, 0);
}
let externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, 0);
if (externalFileAttributes === 0) {
externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, 0);
}
const passThrough = getOptionValue(zipWriter, options, "passThrough");
let password, rawPassword;
if (!passThrough) {
Expand Down Expand Up @@ -10436,6 +10457,7 @@
zipCrypto,
dataDescriptor,
directory,
executable,
versionMadeBy,
rawComment,
rawExtraField,
Expand All @@ -10457,6 +10479,7 @@
versionMadeBy,
zip64,
directory: Boolean(directory),
executable: Boolean(executable),
filenameUTF8: true,
rawFilename,
commentUTF8: true,
Expand Down Expand Up @@ -10917,13 +10940,11 @@
rawComment,
versionMadeBy,
headerArray,
directory,
zip64,
zip64UncompressedSize,
zip64CompressedSize,
zip64DiskNumberStart,
zip64Offset,
msDosCompatible,
internalFileAttributes,
externalFileAttributes,
diskNumberStart,
Expand All @@ -10947,8 +10968,6 @@
setUint16(directoryView, offset + 36, internalFileAttributes);
if (externalFileAttributes) {
setUint32(directoryView, offset + 38, externalFileAttributes);
} else if (directory && msDosCompatible) {
setUint8(directoryView, offset + 38, FILE_ATTR_MSDOS_DIR_MASK);
}
setUint32(directoryView, offset + 42, zip64 && zip64Offset ? MAX_32_BITS : fileEntryOffset);
arraySet(directoryArray, rawFilename, offset + 46);
Expand Down
2 changes: 1 addition & 1 deletion dist/zip-fs-full.min.js

Large diffs are not rendered by default.

55 changes: 37 additions & 18 deletions dist/zip-fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
const FILE_ATTR_MSDOS_DIR_MASK = 0x10;
const FILE_ATTR_UNIX_DIR_MASK = 0x4000;
const FILE_ATTR_UNIX_EXECUTABLE_MASK = 0o111;
const FILE_ATTR_UNIX_DEFAULT_MASK = 0o644;

const VERSION_DEFLATE = 0x14;
const VERSION_ZIP64 = 0x2D;
Expand Down Expand Up @@ -3376,12 +3377,14 @@
const PROPERTY_NAME_VERSION = "version";
const PROPERTY_NAME_VERSION_MADE_BY = "versionMadeBy";
const PROPERTY_NAME_ZIPCRYPTO = "zipCrypto";
const PROPERTY_NAME_DIRECTORY = "directory";
const PROPERTY_NAME_EXECUTABLE = "executable";

const PROPERTY_NAMES = [
PROPERTY_NAME_FILENAME, PROPERTY_NAME_RAW_FILENAME, PROPERTY_NAME_COMPPRESSED_SIZE, PROPERTY_NAME_UNCOMPPRESSED_SIZE,
PROPERTY_NAME_LAST_MODIFICATION_DATE, PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE, PROPERTY_NAME_COMMENT, PROPERTY_NAME_RAW_COMMENT,
PROPERTY_NAME_LAST_ACCESS_DATE, PROPERTY_NAME_CREATION_DATE, PROPERTY_NAME_OFFSET, PROPERTY_NAME_DISK_NUMBER_START,
PROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY, PROPERTY_NAME_ZIPCRYPTO, "directory", "executable", "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];
PROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY, PROPERTY_NAME_ZIPCRYPTO, PROPERTY_NAME_DIRECTORY, PROPERTY_NAME_EXECUTABLE, "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];

class Entry {

Expand Down Expand Up @@ -4226,10 +4229,37 @@

async function addFile(zipWriter, name, reader, options) {
name = name.trim();
if (options.directory && (!name.endsWith(DIRECTORY_SIGNATURE))) {
name += DIRECTORY_SIGNATURE;
} else {
options.directory = name.endsWith(DIRECTORY_SIGNATURE);
const msDosCompatible = getOptionValue(zipWriter, options, PROPERTY_NAME_MS_DOS_COMPATIBLE);
const versionMadeBy = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION_MADE_BY, msDosCompatible ? 20 : 768);
const executable = getOptionValue(zipWriter, options, PROPERTY_NAME_EXECUTABLE);
if (versionMadeBy > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
let externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, 0);
if (externalFileAttributes === 0) {
externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, 0);
}
if (!options.directory && name.endsWith(DIRECTORY_SIGNATURE)) {
options.directory = true;
}
const directory = getOptionValue(zipWriter, options, PROPERTY_NAME_DIRECTORY);
if (directory) {
if (!name.endsWith(DIRECTORY_SIGNATURE)) {
name += DIRECTORY_SIGNATURE;
}
if (externalFileAttributes === 0) {
if (msDosCompatible) {
externalFileAttributes = FILE_ATTR_MSDOS_DIR_MASK;
} else {
externalFileAttributes = FILE_ATTR_UNIX_DIR_MASK << 16;
}
}
} else if (!msDosCompatible && externalFileAttributes === 0) {
if (executable) {
externalFileAttributes = (FILE_ATTR_UNIX_EXECUTABLE_MASK | FILE_ATTR_UNIX_DEFAULT_MASK) << 16;
} else {
externalFileAttributes = FILE_ATTR_UNIX_DEFAULT_MASK << 16;
}
}
const encode = getOptionValue(zipWriter, options, "encodeText", encodeText);
let rawFilename = encode(name);
Expand All @@ -4251,22 +4281,13 @@
if (version > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
const versionMadeBy = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION_MADE_BY, 20);
if (versionMadeBy > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
const lastModDate = getOptionValue(zipWriter, options, PROPERTY_NAME_LAST_MODIFICATION_DATE, new Date());
const lastAccessDate = getOptionValue(zipWriter, options, PROPERTY_NAME_LAST_ACCESS_DATE);
const creationDate = getOptionValue(zipWriter, options, PROPERTY_NAME_CREATION_DATE);
const msDosCompatible = getOptionValue(zipWriter, options, PROPERTY_NAME_MS_DOS_COMPATIBLE, true);
let internalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, 0);
if (internalFileAttributes === 0) {
internalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, 0);
}
let externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, 0);
if (externalFileAttributes === 0) {
externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, 0);
}
const passThrough = getOptionValue(zipWriter, options, "passThrough");
let password, rawPassword;
if (!passThrough) {
Expand Down Expand Up @@ -4589,6 +4610,7 @@
zipCrypto,
dataDescriptor,
directory,
executable,
versionMadeBy,
rawComment,
rawExtraField,
Expand All @@ -4610,6 +4632,7 @@
versionMadeBy,
zip64,
directory: Boolean(directory),
executable: Boolean(executable),
filenameUTF8: true,
rawFilename,
commentUTF8: true,
Expand Down Expand Up @@ -5070,13 +5093,11 @@
rawComment,
versionMadeBy,
headerArray,
directory,
zip64,
zip64UncompressedSize,
zip64CompressedSize,
zip64DiskNumberStart,
zip64Offset,
msDosCompatible,
internalFileAttributes,
externalFileAttributes,
diskNumberStart,
Expand All @@ -5100,8 +5121,6 @@
setUint16(directoryView, offset + 36, internalFileAttributes);
if (externalFileAttributes) {
setUint32(directoryView, offset + 38, externalFileAttributes);
} else if (directory && msDosCompatible) {
setUint8(directoryView, offset + 38, FILE_ATTR_MSDOS_DIR_MASK);
}
setUint32(directoryView, offset + 42, zip64 && zip64Offset ? MAX_32_BITS : fileEntryOffset);
arraySet(directoryArray, rawFilename, offset + 46);
Expand Down
2 changes: 1 addition & 1 deletion dist/zip-fs.min.js

Large diffs are not rendered by default.

55 changes: 37 additions & 18 deletions dist/zip-full.js
Original file line number Diff line number Diff line change
Expand Up @@ -4284,6 +4284,7 @@
const FILE_ATTR_MSDOS_DIR_MASK = 0x10;
const FILE_ATTR_UNIX_DIR_MASK = 0x4000;
const FILE_ATTR_UNIX_EXECUTABLE_MASK = 0o111;
const FILE_ATTR_UNIX_DEFAULT_MASK = 0o644;

const VERSION_DEFLATE = 0x14;
const VERSION_ZIP64 = 0x2D;
Expand Down Expand Up @@ -7591,12 +7592,14 @@
const PROPERTY_NAME_VERSION = "version";
const PROPERTY_NAME_VERSION_MADE_BY = "versionMadeBy";
const PROPERTY_NAME_ZIPCRYPTO = "zipCrypto";
const PROPERTY_NAME_DIRECTORY = "directory";
const PROPERTY_NAME_EXECUTABLE = "executable";

const PROPERTY_NAMES = [
PROPERTY_NAME_FILENAME, PROPERTY_NAME_RAW_FILENAME, PROPERTY_NAME_COMPPRESSED_SIZE, PROPERTY_NAME_UNCOMPPRESSED_SIZE,
PROPERTY_NAME_LAST_MODIFICATION_DATE, PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE, PROPERTY_NAME_COMMENT, PROPERTY_NAME_RAW_COMMENT,
PROPERTY_NAME_LAST_ACCESS_DATE, PROPERTY_NAME_CREATION_DATE, PROPERTY_NAME_OFFSET, PROPERTY_NAME_DISK_NUMBER_START,
PROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY, PROPERTY_NAME_ZIPCRYPTO, "directory", "executable", "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];
PROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY, PROPERTY_NAME_ZIPCRYPTO, PROPERTY_NAME_DIRECTORY, PROPERTY_NAME_EXECUTABLE, "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];

class Entry {

Expand Down Expand Up @@ -8441,10 +8444,37 @@

async function addFile(zipWriter, name, reader, options) {
name = name.trim();
if (options.directory && (!name.endsWith(DIRECTORY_SIGNATURE))) {
name += DIRECTORY_SIGNATURE;
} else {
options.directory = name.endsWith(DIRECTORY_SIGNATURE);
const msDosCompatible = getOptionValue(zipWriter, options, PROPERTY_NAME_MS_DOS_COMPATIBLE);
const versionMadeBy = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION_MADE_BY, msDosCompatible ? 20 : 768);
const executable = getOptionValue(zipWriter, options, PROPERTY_NAME_EXECUTABLE);
if (versionMadeBy > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
let externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, 0);
if (externalFileAttributes === 0) {
externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, 0);
}
if (!options.directory && name.endsWith(DIRECTORY_SIGNATURE)) {
options.directory = true;
}
const directory = getOptionValue(zipWriter, options, PROPERTY_NAME_DIRECTORY);
if (directory) {
if (!name.endsWith(DIRECTORY_SIGNATURE)) {
name += DIRECTORY_SIGNATURE;
}
if (externalFileAttributes === 0) {
if (msDosCompatible) {
externalFileAttributes = FILE_ATTR_MSDOS_DIR_MASK;
} else {
externalFileAttributes = FILE_ATTR_UNIX_DIR_MASK << 16;
}
}
} else if (!msDosCompatible && externalFileAttributes === 0) {
if (executable) {
externalFileAttributes = (FILE_ATTR_UNIX_EXECUTABLE_MASK | FILE_ATTR_UNIX_DEFAULT_MASK) << 16;
} else {
externalFileAttributes = FILE_ATTR_UNIX_DEFAULT_MASK << 16;
}
}
const encode = getOptionValue(zipWriter, options, "encodeText", encodeText);
let rawFilename = encode(name);
Expand All @@ -8466,22 +8496,13 @@
if (version > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
const versionMadeBy = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION_MADE_BY, 20);
if (versionMadeBy > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
const lastModDate = getOptionValue(zipWriter, options, PROPERTY_NAME_LAST_MODIFICATION_DATE, new Date());
const lastAccessDate = getOptionValue(zipWriter, options, PROPERTY_NAME_LAST_ACCESS_DATE);
const creationDate = getOptionValue(zipWriter, options, PROPERTY_NAME_CREATION_DATE);
const msDosCompatible = getOptionValue(zipWriter, options, PROPERTY_NAME_MS_DOS_COMPATIBLE, true);
let internalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, 0);
if (internalFileAttributes === 0) {
internalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, 0);
}
let externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, 0);
if (externalFileAttributes === 0) {
externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, 0);
}
const passThrough = getOptionValue(zipWriter, options, "passThrough");
let password, rawPassword;
if (!passThrough) {
Expand Down Expand Up @@ -8804,6 +8825,7 @@
zipCrypto,
dataDescriptor,
directory,
executable,
versionMadeBy,
rawComment,
rawExtraField,
Expand All @@ -8825,6 +8847,7 @@
versionMadeBy,
zip64,
directory: Boolean(directory),
executable: Boolean(executable),
filenameUTF8: true,
rawFilename,
commentUTF8: true,
Expand Down Expand Up @@ -9285,13 +9308,11 @@
rawComment,
versionMadeBy,
headerArray,
directory,
zip64,
zip64UncompressedSize,
zip64CompressedSize,
zip64DiskNumberStart,
zip64Offset,
msDosCompatible,
internalFileAttributes,
externalFileAttributes,
diskNumberStart,
Expand All @@ -9315,8 +9336,6 @@
setUint16(directoryView, offset + 36, internalFileAttributes);
if (externalFileAttributes) {
setUint32(directoryView, offset + 38, externalFileAttributes);
} else if (directory && msDosCompatible) {
setUint8(directoryView, offset + 38, FILE_ATTR_MSDOS_DIR_MASK);
}
setUint32(directoryView, offset + 42, zip64 && zip64Offset ? MAX_32_BITS : fileEntryOffset);
arraySet(directoryArray, rawFilename, offset + 46);
Expand Down
2 changes: 1 addition & 1 deletion dist/zip-full.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/zip-no-worker-deflate.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/zip-no-worker.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit b608211

Please sign in to comment.