Skip to content

Commit

Permalink
remove IIFE
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Oct 5, 2024
1 parent 8813a68 commit f8750f6
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions tools/update-readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,18 @@ async function fetchSponsorsMarkdown() {
// Main
//-----------------------------------------------------------------------------

(async () => {
const allSponsors = await fetchSponsorsMarkdown();
const allSponsors = await fetchSponsorsMarkdown();

// read readme file
const readme = readFileSync(README_FILE_PATH, "utf8");
// read readme file
const readme = readFileSync(README_FILE_PATH, "utf8");

let newReadme = readme.replace(
/<!--sponsorsstart-->[\w\W]*?<!--sponsorsend-->/u,
`<!--sponsorsstart-->\n\n${allSponsors}\n<!--sponsorsend-->`,
);
let newReadme = readme.replace(
/<!--sponsorsstart-->[\w\W]*?<!--sponsorsend-->/u,
`<!--sponsorsstart-->\n\n${allSponsors}\n<!--sponsorsend-->`,
);

// 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(README_FILE_PATH, newReadme, "utf8");
})();
// output to the files
writeFileSync(README_FILE_PATH, newReadme, "utf8");

0 comments on commit f8750f6

Please sign in to comment.