Skip to content

Commit c8d1316

Browse files
committed
refactor: replace IIFEs with named main functions in scripts
1 parent 21c8fd6 commit c8d1316

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

scripts/coverage-percent.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ async function logCoveragePercentage(argv) {
154154
}
155155

156156
// Main entry point - parse command line arguments and display coverage
157-
void (async () => {
157+
async function main() {
158158
const { values } = parseArgs({
159159
options: {
160160
json: {
@@ -170,4 +170,6 @@ void (async () => {
170170
},
171171
})
172172
await logCoveragePercentage(values)
173-
})()
173+
}
174+
175+
main().catch(console.error)

scripts/taze.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function includesProvenanceDowngradeWarning(output) {
1818
)
1919
}
2020

21-
void (async () => {
21+
async function main() {
2222
// Run with command line arguments
2323
const args = process.argv.slice(2)
2424

@@ -57,4 +57,6 @@ void (async () => {
5757
})
5858

5959
await tazePromise
60-
})()
60+
}
61+
62+
main().catch(console.error)

scripts/update-data-npm.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const npmDataPath = path.join(dataPath, 'npm')
3131
const npmBuiltinNamesJsonPath = path.join(npmDataPath, 'builtin-names.json')
3232
const npmLegacyNamesJsonPath = path.join(npmDataPath, 'legacy-names.json')
3333

34-
void (async () => {
34+
async function main() {
3535
// Lazily access constants.spinner
3636
const { spinner } = constants
3737

@@ -111,4 +111,6 @@ void (async () => {
111111
if (invalidNames.size) {
112112
logger.warn('Removed missing packages:', [...invalidNames])
113113
}
114-
})()
114+
}
115+
116+
main().catch(console.error)

0 commit comments

Comments
 (0)