@iconify/tools 5.0.8 → 5.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/svg/index.js +4 -2
- package/package.json +1 -1
package/lib/svg/index.js
CHANGED
|
@@ -106,9 +106,11 @@ var SVG = class {
|
|
|
106
106
|
if (!parsed) throw new Error("Invalid SVG file: bad viewBox attribute");
|
|
107
107
|
this.viewBox = parsed;
|
|
108
108
|
} else {
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
let width = attribs["width"];
|
|
110
|
+
let height = attribs["height"];
|
|
111
111
|
if (!width || !height) throw new Error("Invalid SVG file: missing dimensions");
|
|
112
|
+
if (typeof width === "string") width = parseFloat(width);
|
|
113
|
+
if (typeof height === "string") height = parseFloat(height);
|
|
112
114
|
const parsed = parseViewBox(`0 0 ${width} ${height}`);
|
|
113
115
|
if (!parsed) throw new Error("Invalid SVG file: bad size attributes and no viewBox");
|
|
114
116
|
this.viewBox = parsed;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "Collection of functions for cleaning up and parsing SVG for Iconify project",
|
|
5
5
|
"author": "Vjacheslav Trushkin",
|
|
6
|
-
"version": "5.0.
|
|
6
|
+
"version": "5.0.9",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"bugs": "https://github.com/iconify/tools/issues",
|
|
9
9
|
"homepage": "https://github.com/iconify/tools",
|