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 Aug 21, 2024
1 parent c85cc4a commit 42ed231
Show file tree
Hide file tree
Showing 16 changed files with 104 additions and 74 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.50",
"version": "2.7.51",
"exports": {
".": "./index.js",
"./data-uri": "./lib/zip-data-uri.js"
Expand Down
34 changes: 21 additions & 13 deletions dist/zip-fs-full.js
Original file line number Diff line number Diff line change
Expand Up @@ -9202,16 +9202,19 @@
const PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE = "externalFileAttribute";
const PROPERTY_NAME_MS_DOS_COMPATIBLE = "msDosCompatible";
const PROPERTY_NAME_ZIP64 = "zip64";
const PROPERTY_NAME_ENCRYPTED = "encrypted";
const PROPERTY_NAME_VERSION = "version";
const PROPERTY_NAME_VERSION_MADE_BY = "versionMadeBy";
const PROPERTY_NAME_ZIPCRYPTO = "zipCrypto";

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_EXTERNAL_FILE_ATTRIBUTE,
PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64,
"directory", "bitFlag", "encrypted", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "version", "versionMadeBy",
"extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS",
"extraFieldExtendedTimestamp", "zipCrypto"];
PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY,
PROPERTY_NAME_ZIPCRYPTO, "directory", "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField",
"extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];

class Entry {

Expand Down Expand Up @@ -10063,11 +10066,11 @@
if (getLength(rawComment) > MAX_16_BITS) {
throw new Error(ERR_INVALID_ENTRY_COMMENT);
}
const version = getOptionValue(zipWriter, options, "version", VERSION_DEFLATE);
const version = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION, VERSION_DEFLATE);
if (version > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
const versionMadeBy = getOptionValue(zipWriter, options, "versionMadeBy", 20);
const versionMadeBy = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION_MADE_BY, 20);
if (versionMadeBy > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
Expand All @@ -10084,7 +10087,7 @@
rawPassword = getOptionValue(zipWriter, options, "rawPassword");
}
const encryptionStrength = getOptionValue(zipWriter, options, "encryptionStrength", 3);
const zipCrypto = getOptionValue(zipWriter, options, "zipCrypto");
const zipCrypto = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIPCRYPTO);
const extendedTimestamp = getOptionValue(zipWriter, options, "extendedTimestamp", true);
const keepOrder = getOptionValue(zipWriter, options, "keepOrder", true);
const level = getOptionValue(zipWriter, options, "level");
Expand All @@ -10096,7 +10099,7 @@
const useCompressionStream = getOptionValue(zipWriter, options, "useCompressionStream");
let dataDescriptor = getOptionValue(zipWriter, options, "dataDescriptor", true);
let zip64 = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIP64);
if ((password !== UNDEFINED_VALUE || rawPassword !== UNDEFINED_VALUE) && encryptionStrength !== UNDEFINED_VALUE && (encryptionStrength < 1 || encryptionStrength > 3)) {
if (!zipCrypto && (password !== UNDEFINED_VALUE || rawPassword !== UNDEFINED_VALUE) && !(encryptionStrength >= 1 && encryptionStrength <= 3)) {
throw new Error(ERR_INVALID_ENCRYPTION_STRENGTH);
}
let rawExtraField = new Uint8Array();
Expand Down Expand Up @@ -10161,7 +10164,7 @@
}
}
zip64 = zip64 || false;
const encrypted = getOptionValue(zipWriter, options, "encrypted");
const encrypted = getOptionValue(zipWriter, options, PROPERTY_NAME_ENCRYPTED);
const { signature } = options;
options = Object.assign({}, options, {
rawFilename,
Expand Down Expand Up @@ -10937,7 +10940,7 @@
if (availableSize < END_OF_CENTRAL_DIR_LENGTH) {
lastDiskNumber++;
}
let zip64 = getOptionValue(zipWriter, options, "zip64");
let zip64 = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIP64);
if (directoryOffset > MAX_32_BITS || directoryDataLength > MAX_32_BITS || filesLength > MAX_16_BITS || lastDiskNumber > MAX_16_BITS) {
if (zip64 === false) {
throw new Error(ERR_UNSUPPORTED_FORMAT);
Expand Down Expand Up @@ -11762,12 +11765,16 @@
encrypted,
zipCrypto,
signature,
compressionMethod
compressionMethod,
extraFieldAES
} = child.data;
let level;
let level, encryptionStrength;
if (compressionMethod === 0) {
level = 0;
}
if (extraFieldAES) {
encryptionStrength = extraFieldAES.strength;
}
zipEntryOptions = {
externalFileAttribute,
versionMadeBy,
Expand All @@ -11783,7 +11790,8 @@
zipCrypto,
signature,
uncompressedSize,
level
level,
encryptionStrength
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/zip-fs-full.min.js

Large diffs are not rendered by default.

34 changes: 21 additions & 13 deletions dist/zip-fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3347,16 +3347,19 @@
const PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE = "externalFileAttribute";
const PROPERTY_NAME_MS_DOS_COMPATIBLE = "msDosCompatible";
const PROPERTY_NAME_ZIP64 = "zip64";
const PROPERTY_NAME_ENCRYPTED = "encrypted";
const PROPERTY_NAME_VERSION = "version";
const PROPERTY_NAME_VERSION_MADE_BY = "versionMadeBy";
const PROPERTY_NAME_ZIPCRYPTO = "zipCrypto";

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_EXTERNAL_FILE_ATTRIBUTE,
PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64,
"directory", "bitFlag", "encrypted", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "version", "versionMadeBy",
"extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS",
"extraFieldExtendedTimestamp", "zipCrypto"];
PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY,
PROPERTY_NAME_ZIPCRYPTO, "directory", "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField",
"extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];

class Entry {

Expand Down Expand Up @@ -4208,11 +4211,11 @@
if (getLength(rawComment) > MAX_16_BITS) {
throw new Error(ERR_INVALID_ENTRY_COMMENT);
}
const version = getOptionValue(zipWriter, options, "version", VERSION_DEFLATE);
const version = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION, VERSION_DEFLATE);
if (version > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
const versionMadeBy = getOptionValue(zipWriter, options, "versionMadeBy", 20);
const versionMadeBy = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION_MADE_BY, 20);
if (versionMadeBy > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
Expand All @@ -4229,7 +4232,7 @@
rawPassword = getOptionValue(zipWriter, options, "rawPassword");
}
const encryptionStrength = getOptionValue(zipWriter, options, "encryptionStrength", 3);
const zipCrypto = getOptionValue(zipWriter, options, "zipCrypto");
const zipCrypto = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIPCRYPTO);
const extendedTimestamp = getOptionValue(zipWriter, options, "extendedTimestamp", true);
const keepOrder = getOptionValue(zipWriter, options, "keepOrder", true);
const level = getOptionValue(zipWriter, options, "level");
Expand All @@ -4241,7 +4244,7 @@
const useCompressionStream = getOptionValue(zipWriter, options, "useCompressionStream");
let dataDescriptor = getOptionValue(zipWriter, options, "dataDescriptor", true);
let zip64 = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIP64);
if ((password !== UNDEFINED_VALUE || rawPassword !== UNDEFINED_VALUE) && encryptionStrength !== UNDEFINED_VALUE && (encryptionStrength < 1 || encryptionStrength > 3)) {
if (!zipCrypto && (password !== UNDEFINED_VALUE || rawPassword !== UNDEFINED_VALUE) && !(encryptionStrength >= 1 && encryptionStrength <= 3)) {
throw new Error(ERR_INVALID_ENCRYPTION_STRENGTH);
}
let rawExtraField = new Uint8Array();
Expand Down Expand Up @@ -4306,7 +4309,7 @@
}
}
zip64 = zip64 || false;
const encrypted = getOptionValue(zipWriter, options, "encrypted");
const encrypted = getOptionValue(zipWriter, options, PROPERTY_NAME_ENCRYPTED);
const { signature } = options;
options = Object.assign({}, options, {
rawFilename,
Expand Down Expand Up @@ -5082,7 +5085,7 @@
if (availableSize < END_OF_CENTRAL_DIR_LENGTH) {
lastDiskNumber++;
}
let zip64 = getOptionValue(zipWriter, options, "zip64");
let zip64 = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIP64);
if (directoryOffset > MAX_32_BITS || directoryDataLength > MAX_32_BITS || filesLength > MAX_16_BITS || lastDiskNumber > MAX_16_BITS) {
if (zip64 === false) {
throw new Error(ERR_UNSUPPORTED_FORMAT);
Expand Down Expand Up @@ -5907,12 +5910,16 @@
encrypted,
zipCrypto,
signature,
compressionMethod
compressionMethod,
extraFieldAES
} = child.data;
let level;
let level, encryptionStrength;
if (compressionMethod === 0) {
level = 0;
}
if (extraFieldAES) {
encryptionStrength = extraFieldAES.strength;
}
zipEntryOptions = {
externalFileAttribute,
versionMadeBy,
Expand All @@ -5928,7 +5935,8 @@
zipCrypto,
signature,
uncompressedSize,
level
level,
encryptionStrength
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/zip-fs.min.js

Large diffs are not rendered by default.

23 changes: 13 additions & 10 deletions dist/zip-full.js
Original file line number Diff line number Diff line change
Expand Up @@ -7570,16 +7570,19 @@
const PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE = "externalFileAttribute";
const PROPERTY_NAME_MS_DOS_COMPATIBLE = "msDosCompatible";
const PROPERTY_NAME_ZIP64 = "zip64";
const PROPERTY_NAME_ENCRYPTED = "encrypted";
const PROPERTY_NAME_VERSION = "version";
const PROPERTY_NAME_VERSION_MADE_BY = "versionMadeBy";
const PROPERTY_NAME_ZIPCRYPTO = "zipCrypto";

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_EXTERNAL_FILE_ATTRIBUTE,
PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64,
"directory", "bitFlag", "encrypted", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "version", "versionMadeBy",
"extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS",
"extraFieldExtendedTimestamp", "zipCrypto"];
PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY,
PROPERTY_NAME_ZIPCRYPTO, "directory", "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField",
"extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];

class Entry {

Expand Down Expand Up @@ -8431,11 +8434,11 @@
if (getLength(rawComment) > MAX_16_BITS) {
throw new Error(ERR_INVALID_ENTRY_COMMENT);
}
const version = getOptionValue(zipWriter, options, "version", VERSION_DEFLATE);
const version = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION, VERSION_DEFLATE);
if (version > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
const versionMadeBy = getOptionValue(zipWriter, options, "versionMadeBy", 20);
const versionMadeBy = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION_MADE_BY, 20);
if (versionMadeBy > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
Expand All @@ -8452,7 +8455,7 @@
rawPassword = getOptionValue(zipWriter, options, "rawPassword");
}
const encryptionStrength = getOptionValue(zipWriter, options, "encryptionStrength", 3);
const zipCrypto = getOptionValue(zipWriter, options, "zipCrypto");
const zipCrypto = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIPCRYPTO);
const extendedTimestamp = getOptionValue(zipWriter, options, "extendedTimestamp", true);
const keepOrder = getOptionValue(zipWriter, options, "keepOrder", true);
const level = getOptionValue(zipWriter, options, "level");
Expand All @@ -8464,7 +8467,7 @@
const useCompressionStream = getOptionValue(zipWriter, options, "useCompressionStream");
let dataDescriptor = getOptionValue(zipWriter, options, "dataDescriptor", true);
let zip64 = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIP64);
if ((password !== UNDEFINED_VALUE || rawPassword !== UNDEFINED_VALUE) && encryptionStrength !== UNDEFINED_VALUE && (encryptionStrength < 1 || encryptionStrength > 3)) {
if (!zipCrypto && (password !== UNDEFINED_VALUE || rawPassword !== UNDEFINED_VALUE) && !(encryptionStrength >= 1 && encryptionStrength <= 3)) {
throw new Error(ERR_INVALID_ENCRYPTION_STRENGTH);
}
let rawExtraField = new Uint8Array();
Expand Down Expand Up @@ -8529,7 +8532,7 @@
}
}
zip64 = zip64 || false;
const encrypted = getOptionValue(zipWriter, options, "encrypted");
const encrypted = getOptionValue(zipWriter, options, PROPERTY_NAME_ENCRYPTED);
const { signature } = options;
options = Object.assign({}, options, {
rawFilename,
Expand Down Expand Up @@ -9305,7 +9308,7 @@
if (availableSize < END_OF_CENTRAL_DIR_LENGTH) {
lastDiskNumber++;
}
let zip64 = getOptionValue(zipWriter, options, "zip64");
let zip64 = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIP64);
if (directoryOffset > MAX_32_BITS || directoryDataLength > MAX_32_BITS || filesLength > MAX_16_BITS || lastDiskNumber > MAX_16_BITS) {
if (zip64 === false) {
throw new Error(ERR_UNSUPPORTED_FORMAT);
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-inflate.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.

23 changes: 13 additions & 10 deletions dist/zip.js
Original file line number Diff line number Diff line change
Expand Up @@ -3347,16 +3347,19 @@
const PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE = "externalFileAttribute";
const PROPERTY_NAME_MS_DOS_COMPATIBLE = "msDosCompatible";
const PROPERTY_NAME_ZIP64 = "zip64";
const PROPERTY_NAME_ENCRYPTED = "encrypted";
const PROPERTY_NAME_VERSION = "version";
const PROPERTY_NAME_VERSION_MADE_BY = "versionMadeBy";
const PROPERTY_NAME_ZIPCRYPTO = "zipCrypto";

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_EXTERNAL_FILE_ATTRIBUTE,
PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64,
"directory", "bitFlag", "encrypted", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "version", "versionMadeBy",
"extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS",
"extraFieldExtendedTimestamp", "zipCrypto"];
PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY,
PROPERTY_NAME_ZIPCRYPTO, "directory", "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField",
"extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];

class Entry {

Expand Down Expand Up @@ -4208,11 +4211,11 @@
if (getLength(rawComment) > MAX_16_BITS) {
throw new Error(ERR_INVALID_ENTRY_COMMENT);
}
const version = getOptionValue(zipWriter, options, "version", VERSION_DEFLATE);
const version = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION, VERSION_DEFLATE);
if (version > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
const versionMadeBy = getOptionValue(zipWriter, options, "versionMadeBy", 20);
const versionMadeBy = getOptionValue(zipWriter, options, PROPERTY_NAME_VERSION_MADE_BY, 20);
if (versionMadeBy > MAX_16_BITS) {
throw new Error(ERR_INVALID_VERSION);
}
Expand All @@ -4229,7 +4232,7 @@
rawPassword = getOptionValue(zipWriter, options, "rawPassword");
}
const encryptionStrength = getOptionValue(zipWriter, options, "encryptionStrength", 3);
const zipCrypto = getOptionValue(zipWriter, options, "zipCrypto");
const zipCrypto = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIPCRYPTO);
const extendedTimestamp = getOptionValue(zipWriter, options, "extendedTimestamp", true);
const keepOrder = getOptionValue(zipWriter, options, "keepOrder", true);
const level = getOptionValue(zipWriter, options, "level");
Expand All @@ -4241,7 +4244,7 @@
const useCompressionStream = getOptionValue(zipWriter, options, "useCompressionStream");
let dataDescriptor = getOptionValue(zipWriter, options, "dataDescriptor", true);
let zip64 = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIP64);
if ((password !== UNDEFINED_VALUE || rawPassword !== UNDEFINED_VALUE) && encryptionStrength !== UNDEFINED_VALUE && (encryptionStrength < 1 || encryptionStrength > 3)) {
if (!zipCrypto && (password !== UNDEFINED_VALUE || rawPassword !== UNDEFINED_VALUE) && !(encryptionStrength >= 1 && encryptionStrength <= 3)) {
throw new Error(ERR_INVALID_ENCRYPTION_STRENGTH);
}
let rawExtraField = new Uint8Array();
Expand Down Expand Up @@ -4306,7 +4309,7 @@
}
}
zip64 = zip64 || false;
const encrypted = getOptionValue(zipWriter, options, "encrypted");
const encrypted = getOptionValue(zipWriter, options, PROPERTY_NAME_ENCRYPTED);
const { signature } = options;
options = Object.assign({}, options, {
rawFilename,
Expand Down Expand Up @@ -5082,7 +5085,7 @@
if (availableSize < END_OF_CENTRAL_DIR_LENGTH) {
lastDiskNumber++;
}
let zip64 = getOptionValue(zipWriter, options, "zip64");
let zip64 = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIP64);
if (directoryOffset > MAX_32_BITS || directoryDataLength > MAX_32_BITS || filesLength > MAX_16_BITS || lastDiskNumber > MAX_16_BITS) {
if (zip64 === false) {
throw new Error(ERR_UNSUPPORTED_FORMAT);
Expand Down
2 changes: 1 addition & 1 deletion dist/zip.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 42ed231

Please sign in to comment.