diff --git a/lib/s3Helper.js b/lib/s3Helper.js index ed73562..efc7f8e 100644 --- a/lib/s3Helper.js +++ b/lib/s3Helper.js @@ -82,8 +82,8 @@ module.exports.parseS3Key = function (key) { } function compareS3Key (a, b) { - const recordPartIndexA = a.Key.substring(47).split('/')[2] - const recordPartIndexB = b.Key.substring(47).split('/')[2] + const recordPartIndexA = a.Key.substring(47).split('/')[1] + const recordPartIndexB = b.Key.substring(47).split('/')[1] if (recordPartIndexA < recordPartIndexB) { return -1 } else if (recordPartIndexA > recordPartIndexB) {