@zip.js/zip.js 2.8.10 → 2.8.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1038,15 +1038,19 @@ function getHeaderInfo(options) {
1038
1038
  let { version, compressionMethod } = options;
1039
1039
  const compressed = !directory && (level > 0 || (level === UNDEFINED_VALUE && compressionMethod !== 0));
1040
1040
  let rawExtraFieldZip64;
1041
+ let rawLocalExtraFieldZip64;
1041
1042
  const uncompressedFile = passThrough || !compressed;
1042
1043
  const zip64ExtraFieldComplete = zip64 && (options.bufferedWrite || ((!zip64UncompressedSize && !zip64CompressedSize) || uncompressedFile));
1043
1044
  if (zip64) {
1044
1045
  let rawExtraFieldZip64Length = 4;
1046
+ let rawLocalExtraFieldZip64Length = 4;
1045
1047
  if (zip64UncompressedSize) {
1046
1048
  rawExtraFieldZip64Length += 8;
1049
+ rawLocalExtraFieldZip64Length += 8;
1047
1050
  }
1048
1051
  if (zip64CompressedSize) {
1049
1052
  rawExtraFieldZip64Length += 8;
1053
+ rawLocalExtraFieldZip64Length += 8;
1050
1054
  }
1051
1055
  if (zip64Offset) {
1052
1056
  rawExtraFieldZip64Length += 8;
@@ -1056,18 +1060,28 @@ function getHeaderInfo(options) {
1056
1060
  }
1057
1061
  rawExtraFieldZip64 = new Uint8Array(rawExtraFieldZip64Length);
1058
1062
  const rawExtraFieldZip64View = getDataView(rawExtraFieldZip64);
1063
+ rawLocalExtraFieldZip64 = new Uint8Array(rawLocalExtraFieldZip64Length);
1064
+ const rawLocalExtraFieldZip64View = getDataView(rawLocalExtraFieldZip64);
1059
1065
  setUint16(rawExtraFieldZip64View, 0, EXTRAFIELD_TYPE_ZIP64);
1060
1066
  setUint16(rawExtraFieldZip64View, 2, getLength(rawExtraFieldZip64) - 4);
1067
+ setUint16(rawLocalExtraFieldZip64View, 0, EXTRAFIELD_TYPE_ZIP64);
1068
+ setUint16(rawLocalExtraFieldZip64View, 2, getLength(rawLocalExtraFieldZip64) - 4);
1061
1069
  if (zip64ExtraFieldComplete) {
1062
1070
  const rawExtraFieldZip64View = getDataView(rawExtraFieldZip64);
1071
+ const rawLocalExtraFieldZip64View = getDataView(rawLocalExtraFieldZip64);
1063
1072
  let rawExtraFieldZip64Offset = 4;
1073
+ let rawLocalExtraFieldZip64Offset = 4;
1064
1074
  if (zip64UncompressedSize) {
1065
1075
  setBigUint64(rawExtraFieldZip64View, rawExtraFieldZip64Offset, BigInt(uncompressedSize));
1066
1076
  rawExtraFieldZip64Offset += 8;
1077
+ setBigUint64(rawLocalExtraFieldZip64View, rawLocalExtraFieldZip64Offset, BigInt(uncompressedSize));
1078
+ rawLocalExtraFieldZip64Offset += 8;
1067
1079
  }
1068
1080
  if (zip64CompressedSize && uncompressedFile) {
1069
1081
  setBigUint64(rawExtraFieldZip64View, rawExtraFieldZip64Offset, BigInt(uncompressedSize));
1070
1082
  rawExtraFieldZip64Offset += 8;
1083
+ setBigUint64(rawLocalExtraFieldZip64View, rawLocalExtraFieldZip64Offset, BigInt(uncompressedSize));
1084
+ rawLocalExtraFieldZip64Offset += 8;
1071
1085
  }
1072
1086
  if (zip64Offset) {
1073
1087
  setBigUint64(rawExtraFieldZip64View, rawExtraFieldZip64Offset, BigInt(offset));
@@ -1080,6 +1094,7 @@ function getHeaderInfo(options) {
1080
1094
  }
1081
1095
  } else {
1082
1096
  rawExtraFieldZip64 = new Uint8Array();
1097
+ rawLocalExtraFieldZip64 = new Uint8Array();
1083
1098
  }
1084
1099
  let rawExtraFieldAES;
1085
1100
  if (encrypted && !zipCrypto) {
@@ -1182,7 +1197,7 @@ function getHeaderInfo(options) {
1182
1197
  rawExtraFieldAES[9] = compressionMethod;
1183
1198
  compressionMethod = COMPRESSION_METHOD_AES;
1184
1199
  }
1185
- const localExtraFieldZip64Length = zip64ExtraFieldComplete ? getLength(rawExtraFieldZip64) : 0;
1200
+ const localExtraFieldZip64Length = zip64ExtraFieldComplete ? getLength(rawLocalExtraFieldZip64) : 0;
1186
1201
  const extraFieldLength = localExtraFieldZip64Length + getLength(rawExtraFieldAES, rawExtraFieldExtendedTimestamp, rawExtraFieldNTFS, rawExtraFieldUnix, rawExtraField);
1187
1202
  const {
1188
1203
  headerArray,
@@ -1207,7 +1222,7 @@ function getHeaderInfo(options) {
1207
1222
  arraySet(localHeaderArray, rawFilename, localHeaderOffset);
1208
1223
  localHeaderOffset += getLength(rawFilename);
1209
1224
  if (zip64ExtraFieldComplete) {
1210
- arraySet(localHeaderArray, rawExtraFieldZip64, localHeaderOffset);
1225
+ arraySet(localHeaderArray, rawLocalExtraFieldZip64, localHeaderOffset);
1211
1226
  }
1212
1227
  localHeaderOffset += localExtraFieldZip64Length;
1213
1228
  arraySet(localHeaderArray, rawExtraFieldAES, localHeaderOffset);
@@ -1380,12 +1395,8 @@ function updateLocalHeader({
1380
1395
  signature,
1381
1396
  compressedSize,
1382
1397
  uncompressedSize,
1383
- offset,
1384
- diskNumberStart,
1385
1398
  zip64UncompressedSize,
1386
- zip64CompressedSize,
1387
- zip64Offset,
1388
- zip64DiskNumberStart
1399
+ zip64CompressedSize
1389
1400
  }, localHeaderView, { dataDescriptor }) {
1390
1401
  if (!dataDescriptor) {
1391
1402
  if (!encrypted) {
@@ -1407,13 +1418,6 @@ function updateLocalHeader({
1407
1418
  setBigUint64(localHeaderView, localHeaderOffset, BigInt(compressedSize));
1408
1419
  localHeaderOffset += 8;
1409
1420
  }
1410
- if (zip64Offset) {
1411
- setBigUint64(localHeaderView, localHeaderOffset, BigInt(offset));
1412
- localHeaderOffset += 8;
1413
- }
1414
- if (zip64DiskNumberStart) {
1415
- setUint32(localHeaderView, localHeaderOffset, diskNumberStart);
1416
- }
1417
1421
  }
1418
1422
  }
1419
1423
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A JavaScript library to zip and unzip files in the browser, Deno and Node.js",
4
4
  "author": "Gildas Lormeau",
5
5
  "license": "BSD-3-Clause",
6
- "version": "2.8.10",
6
+ "version": "2.8.13",
7
7
  "type": "module",
8
8
  "keywords": [
9
9
  "zip",
@@ -154,12 +154,12 @@
154
154
  },
155
155
  "homepage": "https://gildas-lormeau.github.io/zip.js",
156
156
  "devDependencies": {
157
- "@rollup/plugin-replace": "^6.0.2",
157
+ "@rollup/plugin-replace": "^6.0.3",
158
158
  "@rollup/plugin-terser": "^0.4.4",
159
- "eslint": "^9.37.0",
159
+ "eslint": "^9.39.2",
160
160
  "http-server": "^14.1.1",
161
- "rollup": "^4.52.4",
162
- "typedoc": "^0.28.14",
161
+ "rollup": "^4.55.1",
162
+ "typedoc": "^0.28.15",
163
163
  "typedoc-plugin-markdown": "^4.9.0"
164
164
  }
165
165
  }