From add084a8eac4f22236abc1699c45d59bf850d649 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:43:08 +0000 Subject: [PATCH] fix: review comments --- packages/nocodb-sdk/src/lib/helperFunctions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/helperFunctions.ts b/packages/nocodb-sdk/src/lib/helperFunctions.ts index b9fa956923..43a8d878ec 100644 --- a/packages/nocodb-sdk/src/lib/helperFunctions.ts +++ b/packages/nocodb-sdk/src/lib/helperFunctions.ts @@ -114,11 +114,11 @@ function populateUniqueFileName( fileName = `image.${mimeType.split('/')[1]}`; } - let match = fileName.match(/^(.+?)(\((\d+)\))?(\.[^.]+)$/); + const match = fileName.match(/^(.+?)(\((\d+)\))?(\.[^.]+)$/); if (!match) return fileName; - let c = match && !isNaN(parseInt(match[3])) ? parseInt(match[3]) : 1; + let c = !isNaN(parseInt(match[3])) ? parseInt(match[3]) : 1; while (attachments.some((fn) => fn === fileName)) { fileName = `${match[1]}(${c++})${match[4]}`;