From 110657a028b914302d1ef2fa9c013bdb63f84e27 Mon Sep 17 00:00:00 2001 From: pheralb Date: Mon, 25 Aug 2025 19:04:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Refactor=20getAstroCode=20functi?= =?UTF-8?q?on=20to=20use=20destructured=20parameters=20for=20improved=20re?= =?UTF-8?q?adability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/templates/getAstroCode.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/templates/getAstroCode.ts b/src/templates/getAstroCode.ts index 869782b..a4b0ed0 100644 --- a/src/templates/getAstroCode.ts +++ b/src/templates/getAstroCode.ts @@ -2,12 +2,12 @@ interface AstroComponentParams { svgContent: string; } -export function getAstroCode({ svgContent }: AstroComponentParams): string { - const cleanedSvg = svgContent +export function getAstroCode(params: AstroComponentParams): string { + const cleanedSvg = params.svgContent .replace(/\s*(width|height)="[^"]*"/gi, "") .replace(/\s*(width|height)='[^']*'/gi, "") .replace(/\s*(width|height)=\{[^}]*\}/gi, "") - .replace(/]*)>/i, (match, attrs) => { + .replace(/]*)>/i, (_, attrs) => { const cleanedAttrs = attrs.replace(/\s*\{?\.\.\.Astro\.props\}?\s*/i, ""); return ``; });