eslint: add no-shadow

This commit is contained in:
Girish Ramakrishnan
2026-02-18 08:18:37 +01:00
parent 4d3e9dc49b
commit 4ed6fbbd74
40 changed files with 250 additions and 249 deletions
+6 -6
View File
@@ -340,9 +340,9 @@ async function listDir(config, remotePath, batchSize, marker) {
// https://github.com/aws/aws-sdk-js/blob/2b6bcbdec1f274fe931640c1b61ece999aae7a19/lib/util.js#L41
// https://github.com/GeorgePhillips/node-s3-url-encode/blob/master/index.js
// See aws-sdk-js/issues/1302
function encodeCopySource(bucket, path) {
function encodeCopySource(bucket, filePath) {
// AWS percent-encodes some extra non-standard characters in a URI
const output = encodeURI(path).replace(/[+!"#$@&'()*,:;=?@]/g, function(ch) {
const output = encodeURI(filePath).replace(/[+!"#$@&'()*,:;=?@]/g, function(ch) {
return '%' + ch.charCodeAt(0).toString(16).toUpperCase();
});
@@ -440,10 +440,10 @@ async function cleanup(config, progressCallback) {
progressCallback({ message: `Cleaning up any aborted multi-part uploads. count:${uploads.Uploads?.length || 0} truncated:${uploads.IsTruncated}` });
if (!uploads.Uploads) return;
for (const upload of uploads.Uploads) {
if (Date.now() - new Date(upload.Initiated) < 3 * 24 * 60 * 60 * 1000) continue; // 3 days ago
progressCallback({ message: `Cleaning up multi-part upload uploadId:${upload.UploadId} key:${upload.Key}` });
await safe(s3.abortMultipartUpload({ Bucket: config.bucket, Key: upload.Key, UploadId: upload.UploadId }), { debug }); // ignore error
for (const multipartUpload of uploads.Uploads) {
if (Date.now() - new Date(multipartUpload.Initiated) < 3 * 24 * 60 * 60 * 1000) continue; // 3 days ago
progressCallback({ message: `Cleaning up multi-part upload uploadId:${multipartUpload.UploadId} key:${multipartUpload.Key}` });
await safe(s3.abortMultipartUpload({ Bucket: config.bucket, Key: multipartUpload.Key, UploadId: multipartUpload.UploadId }), { debug }); // ignore error
}
}