Skip to content

Commit

Permalink
Convert moduleReport.ts to IIFE
Browse files Browse the repository at this point in the history
Want to use `await` in an upcoming commit.
  • Loading branch information
lawrence-forooghian committed Nov 23, 2023
1 parent 4f26523 commit ac252c6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions scripts/moduleReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,16 @@ function printAndCheckFunctionSizes() {
return errors;
}

const errors: Error[] = [];
(function run() {
const errors: Error[] = [];

errors.push(...printAndCheckModuleSizes());
errors.push(...printAndCheckFunctionSizes());
errors.push(...printAndCheckModuleSizes());
errors.push(...printAndCheckFunctionSizes());

if (errors.length > 0) {
for (const error of errors) {
console.log(error.message);
if (errors.length > 0) {
for (const error of errors) {
console.log(error.message);
}
process.exit(1);
}
process.exit(1);
}
})();

0 comments on commit ac252c6

Please sign in to comment.