Skip to content

Commit

Permalink
Add empty file check from top level
Browse files Browse the repository at this point in the history
No need to unminify empty files
  • Loading branch information
jehna committed Oct 6, 2024
1 parent 3f329ec commit 6fac3f7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/unminify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ export async function unminify(

const file = extractedFiles[i];
const code = await fs.readFile(file.path, "utf-8");

if (code.trim().length === 0) {
verbose.log(`Skipping empty file ${file.path}`);
continue;
}

const formattedCode = await plugins.reduce(
(p, next) => p.then(next),
Promise.resolve(code)
Expand Down

0 comments on commit 6fac3f7

Please sign in to comment.