From ee227ef1a2214b2139ef13d491eee7dd836ea91a Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Mon, 21 Oct 2024 17:31:35 +0200 Subject: [PATCH] chore: Remove unnecessary IIFE in update-readme (#637) --- 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 226a211e..a6df7ab6 100644 --- a/tools/update-readme.js +++ b/tools/update-readme.js @@ -40,23 +40,21 @@ async function fetchSponsorsMarkdown() { // Main //----------------------------------------------------------------------------- -(async () => { - const allSponsors = await fetchSponsorsMarkdown(); +const allSponsors = await fetchSponsorsMarkdown(); - README_FILE_PATHS.forEach(filePath => { +README_FILE_PATHS.forEach(filePath => { - // read readme file - const readme = readFileSync(filePath, "utf8"); + // read readme file + const readme = readFileSync(filePath, "utf8"); - let newReadme = readme.replace( - /[\w\W]*?/u, - `\n${allSponsors}\n` - ); + let newReadme = readme.replace( + /[\w\W]*?/u, + `\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"); +});