diff --git a/src/services/fs.ts b/src/services/fs.ts index 9565cb086..c3ee16f9d 100644 --- a/src/services/fs.ts +++ b/src/services/fs.ts @@ -184,12 +184,12 @@ export const getZipFileStream = async ( }; export async function isFolder(dirPath: string) { - return await fs - .stat(dirPath) - .then((stats) => { - return stats.isDirectory(); - }) - .catch(() => false); + try { + const stats = await fs.stat(dirPath); + return stats.isDirectory(); + } catch (e) { + return false; + } } export const convertBrowserStreamToNode = (