Comparing version 0.12.1 to 0.12.2
@@ -124,3 +124,3 @@ const PullStream = require('../PullStream'); | ||
// relative offset for zip64 central directory record. | ||
if (vars.numberOfRecords == 0xffff|| vars.numberOfRecords == 0xffff || | ||
if (vars.diskNumber == 0xffff || vars.numberOfRecords == 0xffff || | ||
vars.offsetToStartOfCentralDirectory == 0xffffffff) { | ||
@@ -127,0 +127,0 @@ |
@@ -96,3 +96,43 @@ const fs = require('graceful-fs'); | ||
}, | ||
s3_v3: function (client, params, options) { | ||
const { GetObjectCommand, HeadObjectCommand } = require('@aws-sdk/client-s3'); | ||
const source = { | ||
size: async () => { | ||
const head = await client.send( | ||
new HeadObjectCommand({ | ||
Bucket: params.Bucket, | ||
Key: params.Key, | ||
}) | ||
); | ||
if(!head.ContentLength) { | ||
return 0; | ||
} | ||
return head.ContentLength; | ||
}, | ||
stream: (offset, length) => { | ||
const stream = Stream.PassThrough(); | ||
const end = length ? offset + length : ""; | ||
client | ||
.send( | ||
new GetObjectCommand({ | ||
Bucket: params.Bucket, | ||
Key: params.Key, | ||
Range: `bytes=${offset}-${end}`, | ||
}) | ||
) | ||
.then((response) => { | ||
response.Body.pipe(stream); | ||
}) | ||
.catch((error) => { | ||
stream.emit("error", error); | ||
}); | ||
return stream; | ||
}, | ||
}; | ||
return directory(source, options); | ||
}, | ||
custom: function(source, options) { | ||
@@ -99,0 +139,0 @@ return directory(source, options); |
@@ -9,15 +9,18 @@ const parseBuffer = require('./parseBuffer'); | ||
['signature', 2], | ||
['partsize', 2], | ||
['uncompressedSize', 8], | ||
['compressedSize', 8], | ||
['offset', 8], | ||
['disknum', 8], | ||
['partSize', 2], | ||
]); | ||
if(candidateExtra.signature === 0x0001) { | ||
extra = candidateExtra; | ||
// parse buffer based on data in ZIP64 central directory; order is important! | ||
const fieldsToExpect = []; | ||
if (vars.uncompressedSize === 0xffffffff) fieldsToExpect.push(['uncompressedSize', 8]); | ||
if (vars.compressedSize === 0xffffffff) fieldsToExpect.push(['compressedSize', 8]); | ||
if (vars.offsetToLocalFileHeader === 0xffffffff) fieldsToExpect.push(['offsetToLocalFileHeader', 8]); | ||
// slice off the 4 bytes for signature and partSize | ||
extra = parseBuffer.parse(extraField.slice(4), fieldsToExpect); | ||
} else { | ||
// Advance the buffer to the next part. | ||
// The total size of this part is the 4 byte header + partsize. | ||
extraField = extraField.slice(candidateExtra.partsize + 4); | ||
extraField = extraField.slice(candidateExtra.partSize + 4); | ||
} | ||
@@ -35,5 +38,5 @@ } | ||
if (vars.offsetToLocalFileHeader === 0xffffffff) | ||
vars.offsetToLocalFileHeader= extra.offset; | ||
vars.offsetToLocalFileHeader = extra.offsetToLocalFileHeader; | ||
return extra; | ||
}; |
{ | ||
"name": "unzipper", | ||
"version": "0.12.1", | ||
"version": "0.12.2", | ||
"description": "Unzip cross-platform streaming API ", | ||
@@ -26,3 +26,3 @@ "author": "Evan Oxfeld <eoxfeld@gmail.com>", | ||
"dependencies": { | ||
"bluebird": "~3.4.1", | ||
"bluebird": "~3.7.2", | ||
"duplexer2": "~0.1.4", | ||
@@ -36,2 +36,3 @@ "fs-extra": "^11.2.0", | ||
"aws-sdk": "^2.1636.0", | ||
"@aws-sdk/client-s3": "^3.0.0", | ||
"dirdiff": ">= 0.0.1 < 1", | ||
@@ -43,3 +44,3 @@ "eslint": "^9.2.0", | ||
"stream-buffers": ">= 0.2.5 < 1", | ||
"tap": "^12.7.0", | ||
"tap": "^16.3.10", | ||
"temp": ">= 0.4.0 < 1" | ||
@@ -62,4 +63,4 @@ }, | ||
"scripts": { | ||
"test": "npx tap test/*.js --coverage-report=html --reporter=dot" | ||
"test": "npx tap test/*.js --coverage-report=html --lines=90 --functions=85 --statements=90 --branches=80 --reporter=dot" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56586
1137
11
+ Addedbluebird@3.7.2(transitive)
- Removedbluebird@3.4.7(transitive)
Updatedbluebird@~3.7.2