Skip to content

Commit 4de7f60

Browse files
committed
chore: use for loop for processing downlevel files
1 parent 106e231 commit 4de7f60

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/downlevel-dts/downlevelWorkspace.mjs

+5-3
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ export const downlevelWorkspace = async (workspacesDir, workspaceName) => {
3838
try {
3939
await access(downlevelDir);
4040
const files = await getAllFiles(downlevelDir);
41-
files.forEach(async (downlevelTypesFilepath) => {
41+
for (const downlevelTypesFilepath of files) {
4242
try {
4343
const content = await readFile(downlevelTypesFilepath, "utf8");
4444
await writeFile(downlevelTypesFilepath, stripComments(content));
4545
} catch (error) {
4646
console.error(`Error while stripping comments from "${downlevelTypesFilepath.replace(process.cwd(), "")}"`);
4747
console.error(error);
4848
}
49-
});
50-
} catch (error) {}
49+
}
50+
} catch (error) {
51+
// downlevelDir is not present, do nothing.
52+
}
5153
};

0 commit comments

Comments
 (0)