From 33e0a1a057cc883a30a10ccb98f77e12b2a660c0 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 23 May 2022 11:36:07 +0100 Subject: [PATCH] refactor(plugins/tidy-css): replace `forEach()` with `map()` --- src/plugins/tidy-css/index.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/plugins/tidy-css/index.js b/src/plugins/tidy-css/index.js index f180bf3f4..644f7f3d9 100644 --- a/src/plugins/tidy-css/index.js +++ b/src/plugins/tidy-css/index.js @@ -68,20 +68,18 @@ async function plugin(server) { */ if (styleRule.style["font-family"]) { const fonts = styleRule.style["font-family"].split(","); - const parsedFonts = []; - - fonts.forEach((font) => { + const parsedFonts = fonts.map((font) => { if (/[^a-zA-Z-]+/.test(font.trim())) { - parsedFonts.push( - // Stop escaping of