From dc5e5515227ce1724bd32f81e8088a2de1701772 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 5 Sep 2024 16:15:48 -0700 Subject: [PATCH] fix: add missing promise.all for writing --- src/node/lib.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/lib.ts b/src/node/lib.ts index 80f6b2b..41f1f89 100644 --- a/src/node/lib.ts +++ b/src/node/lib.ts @@ -15,11 +15,11 @@ export async function minifyFiles(files: string[], hasComment = false): Promise< // fallback to jasonminify due to missing ARM64 binaries // eslint-disable-next-line @typescript-eslint/no-var-requires const jsonminify = require("jsonminify") - files.map(async (file) => { + await Promise.all(files.map(async (file) => { const jsonString = await readFile(file, "utf8") const minifiedJsonString = jsonminify(jsonString) as string await writeFile(file, minifiedJsonString) - }) + })) return }