From a93b5fb7f1cd2a19f216f2dd6b890b75906c7ad7 Mon Sep 17 00:00:00 2001 From: DenisaCG Date: Fri, 22 Nov 2024 13:19:18 +0100 Subject: [PATCH] update directory check --- src/requests.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/requests.ts b/src/requests.ts index 36c6c46..da34dab 100644 --- a/src/requests.ts +++ b/src/requests.ts @@ -64,10 +64,11 @@ export async function getContents( 'drives/' + driveName + '/' + options.path, 'GET' ); + const isDir: boolean = PathExt.extname(options.path) === ''; if (response.data) { // listing the contents of a directory - if (options.path.indexOf('.') === -1) { + if (isDir) { const fileList: IContentsList = {}; response.data.forEach((row: any) => {