@zip.js/zip.js 2.18.1 → 2.18.2
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.
- package/deno.json +1 -1
- package/dist/zip-core-external.js +6 -14
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +6 -14
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +6 -14
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +6 -14
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +6 -14
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +6 -14
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +6 -14
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +6 -14
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +6 -14
- package/dist/zip-native.min.js +1 -1
- package/dist/zip.js +6 -14
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +6 -14
- package/index-native.min.js +1 -1
- package/index.cjs +6 -14
- package/index.d.cts +6 -5
- package/index.d.ts +6 -5
- package/index.min.js +1 -1
- package/lib/core/version.js +1 -1
- package/lib/core/zip-reader.js +5 -13
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -6030,19 +6030,11 @@ async function detectOverlappingEntry({
|
|
|
6030
6030
|
const zip64 = Boolean(extraFieldZip64);
|
|
6031
6031
|
const dataDescriptorArray = await readUint8Array(reader, dataOffset + compressedSize, DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH);
|
|
6032
6032
|
const dataDescriptorView = getDataView(dataDescriptorArray);
|
|
6033
|
-
const
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize) {
|
|
6039
|
-
localDataDescriptor = candidate;
|
|
6040
|
-
break;
|
|
6041
|
-
}
|
|
6042
|
-
}
|
|
6043
|
-
if (!localDataDescriptor) {
|
|
6044
|
-
localDataDescriptor = readDataDescriptor(dataDescriptorView, zip64, false);
|
|
6045
|
-
}
|
|
6033
|
+
const candidates = [[zip64, true], [zip64, false], [!zip64, true], [!zip64, false]]
|
|
6034
|
+
.map(([zip64Layout, signature]) => readDataDescriptor(dataDescriptorView, zip64Layout, signature))
|
|
6035
|
+
.filter(candidate => candidate && candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize);
|
|
6036
|
+
const localDataDescriptor = candidates.find(candidate => candidate.crc32 == crc32) || candidates[0] ||
|
|
6037
|
+
readDataDescriptor(dataDescriptorView, zip64, true) || readDataDescriptor(dataDescriptorView, zip64, false);
|
|
6046
6038
|
if (localDataDescriptor) {
|
|
6047
6039
|
fileEntry.localDirectory.dataDescriptor = localDataDescriptor;
|
|
6048
6040
|
dataDescriptorLength = getDataDescriptorLength(localDataDescriptor.zip64, localDataDescriptor.signature);
|
|
@@ -9057,7 +9049,7 @@ function formatSupported(StreamClass, format) {
|
|
|
9057
9049
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
9058
9050
|
*/
|
|
9059
9051
|
|
|
9060
|
-
const VERSION = "2.18.
|
|
9052
|
+
const VERSION = "2.18.2";
|
|
9061
9053
|
|
|
9062
9054
|
/*
|
|
9063
9055
|
Copyright (c) 2025 Gildas Lormeau. All rights reserved.
|
package/index.d.cts
CHANGED
|
@@ -2240,8 +2240,8 @@ export interface LocalDataDescriptor {
|
|
|
2240
2240
|
* `true` if the record is preceded by its optional signature.
|
|
2241
2241
|
*
|
|
2242
2242
|
* The signature is not part of the original format, it is a later convention writers are free to follow. It is
|
|
2243
|
-
*
|
|
2244
|
-
*
|
|
2243
|
+
* `false` when the record is read as starting at its first byte, see {@link LocalDataDescriptor#zip64} for how the
|
|
2244
|
+
* layout is chosen.
|
|
2245
2245
|
*/
|
|
2246
2246
|
signature: boolean;
|
|
2247
2247
|
/**
|
|
@@ -2251,9 +2251,10 @@ export interface LocalDataDescriptor {
|
|
|
2251
2251
|
* sizes, and the Zip64 extra field of the central directory record, written last, describes that record, not the
|
|
2252
2252
|
* descriptor, so e.g. an entry placed past 4 GB can carry a Zip64 extra field in its central directory record for
|
|
2253
2253
|
* its offset alone and a descriptor with 4-byte sizes. The record is therefore read with the layout, among the two
|
|
2254
|
-
* widths with and without the signature, whose
|
|
2255
|
-
*
|
|
2256
|
-
* the signature
|
|
2254
|
+
* widths with and without the signature, whose sizes agree with the central directory, its CRC-32 too when the
|
|
2255
|
+
* central directory stores one and several layouts qualify; when none does, the width announced by the Zip64 extra
|
|
2256
|
+
* field of the local file header or of the central directory record is used, with the signature when the record
|
|
2257
|
+
* starts with one.
|
|
2257
2258
|
*/
|
|
2258
2259
|
zip64: boolean;
|
|
2259
2260
|
/**
|
package/index.d.ts
CHANGED
|
@@ -2240,8 +2240,8 @@ export interface LocalDataDescriptor {
|
|
|
2240
2240
|
* `true` if the record is preceded by its optional signature.
|
|
2241
2241
|
*
|
|
2242
2242
|
* The signature is not part of the original format, it is a later convention writers are free to follow. It is
|
|
2243
|
-
*
|
|
2244
|
-
*
|
|
2243
|
+
* `false` when the record is read as starting at its first byte, see {@link LocalDataDescriptor#zip64} for how the
|
|
2244
|
+
* layout is chosen.
|
|
2245
2245
|
*/
|
|
2246
2246
|
signature: boolean;
|
|
2247
2247
|
/**
|
|
@@ -2251,9 +2251,10 @@ export interface LocalDataDescriptor {
|
|
|
2251
2251
|
* sizes, and the Zip64 extra field of the central directory record, written last, describes that record, not the
|
|
2252
2252
|
* descriptor, so e.g. an entry placed past 4 GB can carry a Zip64 extra field in its central directory record for
|
|
2253
2253
|
* its offset alone and a descriptor with 4-byte sizes. The record is therefore read with the layout, among the two
|
|
2254
|
-
* widths with and without the signature, whose
|
|
2255
|
-
*
|
|
2256
|
-
* the signature
|
|
2254
|
+
* widths with and without the signature, whose sizes agree with the central directory, its CRC-32 too when the
|
|
2255
|
+
* central directory stores one and several layouts qualify; when none does, the width announced by the Zip64 extra
|
|
2256
|
+
* field of the local file header or of the central directory record is used, with the signature when the record
|
|
2257
|
+
* starts with one.
|
|
2257
2258
|
*/
|
|
2258
2259
|
zip64: boolean;
|
|
2259
2260
|
/**
|