From 75dddbe24f370fb6a98999d1dd3675c8a7627e86 Mon Sep 17 00:00:00 2001 From: AlexeyBarabash Date: Tue, 5 Mar 2019 13:51:52 +0200 Subject: [PATCH] fix sorting --- lib/s3Helper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {