From 0911a8f407fc88d43d052756187fb919f8638d29 Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Tue, 8 Oct 2024 19:09:36 +0200 Subject: [PATCH] remove IIFE --- tools/update-readme.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/tools/update-readme.js b/tools/update-readme.js index 15b132f..48f1dcb 100644 --- a/tools/update-readme.js +++ b/tools/update-readme.js @@ -41,22 +41,20 @@ async function fetchSponsorsMarkdown() { // Main //----------------------------------------------------------------------------- -(async () => { - const allSponsors = await fetchSponsorsMarkdown(); +const allSponsors = await fetchSponsorsMarkdown(); - README_FILE_PATHS.forEach(filePath => { - // read readme file - const readme = readFileSync(filePath, "utf8"); +README_FILE_PATHS.forEach(filePath => { + // read readme file + const readme = readFileSync(filePath, "utf8"); - let newReadme = readme.replace( - /[\w\W]*?/u, - `\n\n${allSponsors}\n`, - ); + let newReadme = readme.replace( + /[\w\W]*?/u, + `\n\n${allSponsors}\n`, + ); - // replace multiple consecutive blank lines with just one blank line - newReadme = newReadme.replace(/(?<=^|\n)\n{2,}/gu, "\n"); + // replace multiple consecutive blank lines with just one blank line + newReadme = newReadme.replace(/(?<=^|\n)\n{2,}/gu, "\n"); - // output to the files - writeFileSync(filePath, newReadme, "utf8"); - }); -})(); + // output to the files + writeFileSync(filePath, newReadme, "utf8"); +});