Skip to content

Commit

Permalink
chore: apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
likui628 committed Aug 23, 2024
1 parent b2c7ef6 commit f61303a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/icons/src/svg/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ function parseSvg(svgData: string): IconifyIcon {
.join('');

const viewBoxValue = svgElement.getAttribute('viewBox') || '';
const [left, top, width, height] = viewBoxValue.split(' ').map(Number);
const [left, top, width, height] = viewBoxValue.split(' ').map((val) => {
const num = Number(val);
return Number.isNaN(num) ? undefined : num;
});

return {
body: svgContent,
Expand Down

0 comments on commit f61303a

Please sign in to comment.