From 9e80606606755a246a0f0530c249184083435d50 Mon Sep 17 00:00:00 2001 From: opoet Date: Sat, 5 Nov 2022 19:16:31 +0800 Subject: [PATCH] use join instead of reduce and slice --- components/FileListing.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/FileListing.tsx b/components/FileListing.tsx index 3ddba42..f581839 100644 --- a/components/FileListing.tsx +++ b/components/FileListing.tsx @@ -276,8 +276,7 @@ const FileListing: FC<{ query?: ParsedUrlQuery }> = ({ query }) => { c => `${baseUrl}/api/raw/?path=${path}/${encodeURIComponent(c.name)}${hashedToken ? `&odpt=${hashedToken}` : ''}` ) - .reduce((urls, cur) => urls + cur + '\n', '') - .slice(0, -1) + .join('\n') } // Folder recursive download