use join instead of reduce and slice

This commit is contained in:
opoet 2022-11-05 19:16:31 +08:00
parent 8bf97d01c4
commit 9e80606606

View file

@ -276,8 +276,7 @@ const FileListing: FC<{ query?: ParsedUrlQuery }> = ({ query }) => {
c => c =>
`${baseUrl}/api/raw/?path=${path}/${encodeURIComponent(c.name)}${hashedToken ? `&odpt=${hashedToken}` : ''}` `${baseUrl}/api/raw/?path=${path}/${encodeURIComponent(c.name)}${hashedToken ? `&odpt=${hashedToken}` : ''}`
) )
.reduce((urls, cur) => urls + cur + '\n', '') .join('\n')
.slice(0, -1)
} }
// Folder recursive download // Folder recursive download