From 68243764971614eda22a4ba9573db08ef7cdb889 Mon Sep 17 00:00:00 2001 From: alana314 Date: Tue, 19 Jul 2022 14:18:01 -0700 Subject: [PATCH] array slice fix Thanks for this! It works for my purposes but I needed to modify array.slice to reduce the array to 1000 so that my request wasn't too big. --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 4d3a01f..a20d69b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,7 +13,7 @@ import * as env from 'env-var' let oldObjects = s3Objects.filter(s3Object => !isOldObject(s3Object)) if (oldObjects.length > 0) { oldObjects = oldObjects.map(s3Object => ({ Key: s3Object.Key })) - oldObjects.slice(0, 1000) + oldObjects = oldObjects.slice(0, 1000) await deleteObjects(oldObjects) } console.info(`${s3Objects.length} objects found`)