fix: await importDirectory call (#2770)

await importDirectory to ensure all recursive calls inside the function are completed before calling fileLoader
This commit is contained in:
Matthew Hatcher
2023-02-06 13:28:21 -06:00
committed by GitHub
parent 3579e9ee7e
commit 39939d472d
+2 -3
View File
@@ -55,12 +55,11 @@ export async function fastFileLoader(
before?: (uniqueFilePathCounter: number, paths: string[]) => void,
) {
await Promise.all(
[...paths].map((path) => {
[...paths].map(async (path) => {
if (between) between(path, uniqueFilePathCounter, paths);
importDirectory(path);
await importDirectory(path);
}),
);
if (before) before(uniqueFilePathCounter, paths);
await fileLoader();