From 510db568eb9cb09d6ef9fafb089b3f455fcee13f Mon Sep 17 00:00:00 2001 From: TobiGr Date: Thu, 24 Aug 2023 11:53:35 +0200 Subject: [PATCH] Image minizier: replace Number.toFixed(0) with Math.floor() Number.toFixed returns a string, Math.floor a number --- .github/workflows/image-minimizer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/image-minimizer.js b/.github/workflows/image-minimizer.js index d3532ad83..d099068ba 100644 --- a/.github/workflows/image-minimizer.js +++ b/.github/workflows/image-minimizer.js @@ -86,7 +86,7 @@ module.exports = async ({github, context}) => { }); } - // Asnyc replace function from https://stackoverflow.com/a/48032528 + // Async replace function from https://stackoverflow.com/a/48032528 async function replaceAsync(str, regex, asyncFn) { const promises = []; str.replace(regex, (match, ...args) => { @@ -138,7 +138,7 @@ module.exports = async ({github, context}) => { if (shouldModify) { wasMatchModified = true; console.log(`Modifying match '${match}'`); - return `${g1}`; + return `${g1}`; } console.log(`Match '${match}' is ok/will not be modified`);