From 557a0675be9c96e0e0e5c8a5acad9aea3712062b Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Thu, 4 Sep 2025 15:03:43 +0200 Subject: [PATCH] Refactors file stat to use async API Updates file stat operation to use the asynchronous API to prevent blocking the event loop during file system operations. This improves the responsiveness of the application, especially when dealing with potentially slow or numerous file system accesses. --- src/converters/PandocTypstConverter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/converters/PandocTypstConverter.ts b/src/converters/PandocTypstConverter.ts index 12ae15e..437e20f 100644 --- a/src/converters/PandocTypstConverter.ts +++ b/src/converters/PandocTypstConverter.ts @@ -308,7 +308,7 @@ export class PandocTypstConverter { let stat; try { - stat = fs.statSync(itemPath); + stat = await fsPromises.stat(itemPath); } catch (error) { // File might have been deleted between readdirSync and statSync console.warn(`Export: Unable to stat ${itemPath}:`, error.message);