Skip to content

Commit 2b26242

Browse files
fix: resolve TypeScript error in logo imageUrl type narrowing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 631f192 commit 2b26242

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/renderers/svg/logo.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,19 @@ export function calculateLogoPlacement(
8383
const icoMatch = options.imageUrl.match(
8484
/^data:image\/(x-icon|vnd\.microsoft\.icon);base64,(.+)$/i,
8585
);
86+
let imageUrl = options.imageUrl;
8687
if (icoMatch) {
8788
const binary = atob(icoMatch[2]!);
8889
const bytes = new Uint8Array(binary.length);
8990
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
90-
options = { ...options, imageUrl: icoToPngDataURI(bytes) };
91+
imageUrl = icoToPngDataURI(bytes);
9192
}
9293
const imgW = options.imageWidth ?? logoPixelSize;
9394
const imgH = options.imageHeight ?? logoPixelSize;
9495
// Center the image within the logo area
9596
const imgX = logoX + (logoPixelSize - imgW) / 2;
9697
const imgY = logoY + (logoPixelSize - imgH) / 2;
97-
svg += `<image href="${escapeAttr(options.imageUrl)}" x="${imgX}" y="${imgY}" width="${imgW}" height="${imgH}"/>`;
98+
svg += `<image href="${escapeAttr(imageUrl)}" x="${imgX}" y="${imgY}" width="${imgW}" height="${imgH}"/>`;
9899
}
99100

100101
return { svg, hiddenModules };

0 commit comments

Comments
 (0)