@iconify/tools 5.0.1 → 5.0.3

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.
@@ -56,21 +56,21 @@ function parseColors(svg, options = {}) {
56
56
  /**
57
57
  * Get element color
58
58
  */
59
- function getElementColor(prop, item, elements$1) {
60
- function find(prop$1) {
59
+ function getElementColor(prop, item, elements) {
60
+ function find(prop) {
61
61
  let currentItem = item;
62
- const allowDefaultColor = allowDefaultColorValue[prop$1];
62
+ const allowDefaultColor = allowDefaultColorValue[prop];
63
63
  while (currentItem) {
64
- const element = elements$1.get(currentItem.index);
65
- const color = element._colors?.[prop$1];
64
+ const element = elements.get(currentItem.index);
65
+ const color = element._colors?.[prop];
66
66
  if (color !== void 0) return color;
67
67
  if (allowDefaultColor) {
68
68
  if (allowDefaultColor === true || element.attribs[allowDefaultColor]) return null;
69
69
  }
70
70
  currentItem = currentItem.parent;
71
- if (currentItem?.usedAsMask) return defaultColorValues[prop$1];
71
+ if (currentItem?.usedAsMask) return defaultColorValues[prop];
72
72
  }
73
- return defaultColorValues[prop$1];
73
+ return defaultColorValues[prop];
74
74
  }
75
75
  let propColor = find(prop);
76
76
  if (propColor !== null && typeof propColor === "object" && propColor.type === "current" && prop !== "color") propColor = find("color");
@@ -126,15 +126,15 @@ function parseColors(svg, options = {}) {
126
126
  const removedElements = /* @__PURE__ */ new Set();
127
127
  const parsedElements = /* @__PURE__ */ new Set();
128
128
  function removeElement(index, element) {
129
- function removeChildren(element$1) {
130
- element$1.children.forEach((item) => {
129
+ function removeChildren(element) {
130
+ element.children.forEach((item) => {
131
131
  if (item.type !== "tag") return;
132
- const element$2 = item;
133
- const index$1 = element$2._index;
134
- if (index$1 && !removedElements.has(index$1)) {
135
- element$2._removed = true;
136
- removedElements.add(index$1);
137
- removeChildren(element$2);
132
+ const element = item;
133
+ const index = element._index;
134
+ if (index && !removedElements.has(index)) {
135
+ element._removed = true;
136
+ removedElements.add(index);
137
+ removeChildren(element);
138
138
  }
139
139
  });
140
140
  }
@@ -19,8 +19,8 @@ function tokensTree(tokens) {
19
19
  target.push(newItem);
20
20
  parse(newItem.children);
21
21
  if (!newItem.children.length) {
22
- const index$1 = target.indexOf(newItem);
23
- if (index$1 !== -1) target.splice(index$1, 1);
22
+ const index = target.indexOf(newItem);
23
+ if (index !== -1) target.splice(index, 1);
24
24
  }
25
25
  break;
26
26
  }
@@ -11,7 +11,7 @@ async function getGitLabRepoHash(options) {
11
11
  });
12
12
  if (!response.success) throw new Error(`Error downloading data from GitLab API: ${response.error}`);
13
13
  const content = JSON.parse(response.content);
14
- const item = (content instanceof Array ? content : [content]).find((item$1) => item$1.name === options.branch && typeof item$1.commit.id === "string");
14
+ const item = (content instanceof Array ? content : [content]).find((item) => item.name === options.branch && typeof item.commit.id === "string");
15
15
  if (!item) throw new Error("Error parsing GitLab API response");
16
16
  return item.commit.id;
17
17
  }
@@ -8,9 +8,9 @@ import { unzip as unzip$1 } from "fflate";
8
8
  async function unzip(source, path, filter) {
9
9
  const dir = normalize(path);
10
10
  const data = await readFile(source);
11
- async function writeFiles(data$1) {
11
+ async function writeFiles(data) {
12
12
  const createdDirs = /* @__PURE__ */ new Set();
13
- for (const name in data$1) {
13
+ for (const name in data) {
14
14
  const filePath = normalize(join(dir, name));
15
15
  if (filter && !filter(filePath)) continue;
16
16
  if (filePath.startsWith("/") || filePath.includes("../") || filePath.includes(":")) throw new Error("Invalid file path in zip: " + filePath);
@@ -23,16 +23,16 @@ async function unzip(source, path, filter) {
23
23
  await mkdir(fileDir, { recursive: true });
24
24
  } catch {}
25
25
  }
26
- if (!isDir) await writeFile(filePath, data$1[name]);
26
+ if (!isDir) await writeFile(filePath, data[name]);
27
27
  }
28
28
  }
29
- return new Promise((resolve$1, reject) => {
29
+ return new Promise((resolve, reject) => {
30
30
  unzip$1(data, (err, unzipped) => {
31
31
  if (err) {
32
32
  reject(err);
33
33
  return;
34
34
  }
35
- writeFiles(unzipped).then(() => resolve$1()).catch((err$1) => reject(err$1));
35
+ writeFiles(unzipped).then(() => resolve()).catch((err) => reject(err));
36
36
  });
37
37
  });
38
38
  }
@@ -21,16 +21,16 @@ async function exportIconPackage(iconSet, options) {
21
21
  const esm = options.module !== false;
22
22
  const dir = await prepareDirectoryForExport(options);
23
23
  const typesContent = options.typesContent || defaultTypesContent;
24
- await iconSet.forEach(async (name$1) => {
25
- const data = iconSet.resolve(name$1, false);
24
+ await iconSet.forEach(async (name) => {
25
+ const data = iconSet.resolve(name, false);
26
26
  if (!data) return;
27
- const typesFilename = name$1 + ".d.ts";
27
+ const typesFilename = name + ".d.ts";
28
28
  await promises.writeFile(`${dir}/${typesFilename}`, typesContent, "utf8");
29
29
  files.add(typesFilename);
30
30
  let content = `const data = ` + JSON.stringify(data, null, " ") + ";\n";
31
31
  if (!esm) content += "exports.__esModule = true;\nexports.default = data;\n";
32
32
  else content += "export default data;\n";
33
- const contentFilename = name$1 + ".js";
33
+ const contentFilename = name + ".js";
34
34
  await promises.writeFile(`${dir}/${contentFilename}`, content, "utf8");
35
35
  files.add(contentFilename);
36
36
  });
@@ -206,11 +206,11 @@ var IconSet = class {
206
206
  const tree = item && (item.type === "icon" ? [] : this.getTree([name])[name]);
207
207
  if (!tree) return null;
208
208
  let result = {};
209
- function parse(name$1) {
210
- const item$1 = entries[name$1];
211
- if (item$1.type === "alias") return;
212
- result = mergeIconData(item$1.props, result);
213
- if (item$1.type === "icon") result.body = item$1.body;
209
+ function parse(name) {
210
+ const item = entries[name];
211
+ if (item.type === "alias") return;
212
+ result = mergeIconData(item.props, result);
213
+ if (item.type === "icon") result.body = item.body;
214
214
  }
215
215
  parse(name);
216
216
  tree.forEach(parse);
@@ -283,10 +283,10 @@ var IconSet = class {
283
283
  if (Object.keys(chars).length) result.chars = chars;
284
284
  const categories = Object.create(null);
285
285
  Array.from(this.categories).sort((a, b) => a.title.localeCompare(b.title)).forEach((item) => {
286
- const names$1 = this.listCategory(item);
287
- if (names$1) {
288
- names$1.sort((a, b) => a.localeCompare(b));
289
- categories[item.title] = names$1;
286
+ const names = this.listCategory(item);
287
+ if (names) {
288
+ names.sort((a, b) => a.localeCompare(b));
289
+ categories[item.title] = names;
290
290
  }
291
291
  });
292
292
  if (Object.keys(categories).length) result.categories = categories;
@@ -414,14 +414,14 @@ var IconSet = class {
414
414
  delete entries[name];
415
415
  let count = 1;
416
416
  function remove(parent) {
417
- Object.keys(entries).filter((name$1) => {
418
- const item = entries[name$1];
417
+ Object.keys(entries).filter((name) => {
418
+ const item = entries[name];
419
419
  return item.type !== "icon" && item.parent === parent;
420
- }).forEach((name$1) => {
421
- if (entries[name$1]) {
422
- delete entries[name$1];
420
+ }).forEach((name) => {
421
+ if (entries[name]) {
422
+ delete entries[name];
423
423
  count++;
424
- remove(name$1);
424
+ remove(name);
425
425
  }
426
426
  });
427
427
  }
@@ -45,12 +45,12 @@ function isValidFile(item) {
45
45
  */
46
46
  function importDirectory(path, options = {}) {
47
47
  return new Promise((fulfill, reject) => {
48
- scanDirectory(path, (ext, file, subdir, path$1) => {
48
+ scanDirectory(path, (ext, file, subdir, path) => {
49
49
  const result = {
50
50
  file,
51
51
  ext,
52
52
  subdir,
53
- path: path$1
53
+ path
54
54
  };
55
55
  return isValidFile(result) ? result : false;
56
56
  }, options.includeSubDirs !== false).then((files) => {
@@ -75,12 +75,12 @@ function importDirectory(path, options = {}) {
75
75
  * Import all icons from directory synchronously
76
76
  */
77
77
  function importDirectorySync(path, options = {}) {
78
- const files = scanDirectorySync(path, (ext, file, subdir, path$1) => {
78
+ const files = scanDirectorySync(path, (ext, file, subdir, path) => {
79
79
  const result = {
80
80
  file,
81
81
  ext,
82
82
  subdir,
83
- path: path$1
83
+ path
84
84
  };
85
85
  return isValidFile(result) ? result : false;
86
86
  }, options.includeSubDirs !== false);
@@ -29,12 +29,12 @@ async function figmaFilesQuery(options, cache) {
29
29
  if (!cachedData) return true;
30
30
  let ifModifiedSince;
31
31
  if (options.ifModifiedSince === true) try {
32
- const parsedData$1 = JSON.parse(cachedData);
33
- if (typeof parsedData$1.lastModified !== "string") {
32
+ const parsedData = JSON.parse(cachedData);
33
+ if (typeof parsedData.lastModified !== "string") {
34
34
  await clearAPICache(cache.dir);
35
35
  return true;
36
36
  }
37
- ifModifiedSince = parsedData$1.lastModified;
37
+ ifModifiedSince = parsedData.lastModified;
38
38
  } catch {
39
39
  await clearAPICache(cache.dir);
40
40
  return true;
@@ -45,10 +45,10 @@ async function figmaFilesQuery(options, cache) {
45
45
  params: new URLSearchParams(params)
46
46
  };
47
47
  versionCheckParams.params.set("depth", "1");
48
- const response$1 = await sendAPIQuery(versionCheckParams);
48
+ const response = await sendAPIQuery(versionCheckParams);
49
49
  try {
50
- if (response$1.success) {
51
- if (identicalDates(JSON.parse(response$1.content).lastModified, ifModifiedSince)) return false;
50
+ if (response.success) {
51
+ if (identicalDates(JSON.parse(response.content).lastModified, ifModifiedSince)) return false;
52
52
  }
53
53
  } catch {}
54
54
  await clearAPICache(cache.dir);
@@ -79,10 +79,10 @@ async function figmaImagesQuery(options, nodes, cache) {
79
79
  const uri = "https://api.figma.com/v1/images/" + options.file;
80
80
  const maxLength = 2048 - uri.length;
81
81
  const svgOptions = options.svgOptions || {};
82
- const query = (ids$1) => {
82
+ const query = (ids) => {
83
83
  return new Promise((resolve, reject) => {
84
84
  const params = new URLSearchParams({
85
- ids: ids$1.join(","),
85
+ ids: ids.join(","),
86
86
  format: "svg"
87
87
  });
88
88
  if (options.version) params.set("version", options.version);
@@ -37,9 +37,9 @@ async function compareDirectories(dir1, dir2, options) {
37
37
  if (!files2.includes(file)) return false;
38
38
  const ext = file.split(".").pop().toLowerCase();
39
39
  if (!textExtensions.has(ext)) {
40
- const content1$1 = await promises.readFile(dir1 + "/" + file);
41
- const content2$1 = await promises.readFile(dir2 + "/" + file);
42
- if (Buffer.compare(content1$1, content2$1) !== 0) return false;
40
+ const content1 = await promises.readFile(dir1 + "/" + file);
41
+ const content2 = await promises.readFile(dir2 + "/" + file);
42
+ if (Buffer.compare(content1, content2) !== 0) return false;
43
43
  continue;
44
44
  }
45
45
  let content1 = await promises.readFile(dir1 + "/" + file, "utf8");
@@ -79,39 +79,39 @@ function remove(svg) {
79
79
  parseSVG(svg, (item) => {
80
80
  const node = item.node;
81
81
  const tagName = node.tag;
82
- const attribs$1 = node.attribs;
83
- Object.keys(attribs$1).forEach((attr) => {
84
- const value = attribs$1[attr];
82
+ const attribs = node.attribs;
83
+ Object.keys(attribs).forEach((attr) => {
84
+ const value = attribs[attr];
85
85
  if (typeof value !== "string") return;
86
86
  switch (attr) {
87
87
  case "id":
88
- if (!maskTags.has(tagName) && !symbolTag.has(tagName)) delete attribs$1[attr];
88
+ if (!maskTags.has(tagName) && !symbolTag.has(tagName)) delete attribs[attr];
89
89
  break;
90
90
  case "class":
91
91
  case "xmlns:xlink":
92
92
  case "version":
93
- delete attribs$1[attr];
93
+ delete attribs[attr];
94
94
  break;
95
95
  case "transform": {
96
96
  const trimmed = value.replace(/\s+/g, "").replace(/\.0+/g, "");
97
- if (!trimmed || trimmed === "matrix(1,0,0,1,0,0)") delete attribs$1[attr];
97
+ if (!trimmed || trimmed === "matrix(1,0,0,1,0,0)") delete attribs[attr];
98
98
  break;
99
99
  }
100
100
  case "rx":
101
101
  case "ry":
102
102
  case "x":
103
103
  case "y":
104
- if (value === "0") delete attribs$1[attr];
104
+ if (value === "0") delete attribs[attr];
105
105
  break;
106
106
  case "fill-opacity":
107
107
  case "stroke-opacity":
108
108
  case "opacity":
109
- if (value === "1") delete attribs$1[attr];
109
+ if (value === "1") delete attribs[attr];
110
110
  break;
111
111
  case "fill":
112
112
  case "stroke": {
113
113
  const colorValue = stringToColor(value);
114
- if (colorValue?.type === "rgb") attribs$1[attr] = colorToString(colorValue);
114
+ if (colorValue?.type === "rgb") attribs[attr] = colorToString(colorValue);
115
115
  }
116
116
  }
117
117
  });
@@ -135,9 +135,9 @@ function remove(svg) {
135
135
  if (node.type === "tag") {
136
136
  const tagName = node.tag;
137
137
  if (!defsTag.has(tagName) && !maskTags.has(tagName) && !symbolTag.has(tagName)) {
138
- const clipPath$1 = node.attribs["clip-path"];
139
- if (typeof clipPath$1 !== "string" || !clipPath$1.startsWith(urlStart) || !clipPath$1.endsWith(urlEnd)) return false;
140
- const id = clipPath$1.slice(5, -1);
138
+ const clipPath = node.attribs["clip-path"];
139
+ if (typeof clipPath !== "string" || !clipPath.startsWith(urlStart) || !clipPath.endsWith(urlEnd)) return false;
140
+ const id = clipPath.slice(5, -1);
141
141
  if (typeof clipID === "string" && clipID !== id) return false;
142
142
  clipID = id;
143
143
  shapesToClip.push(node);
@@ -24,8 +24,8 @@ function cleanupGlobalStyle(svg) {
24
24
  ].forEach((attr) => {
25
25
  const value = attribs[attr];
26
26
  if (typeof value !== "string") return;
27
- value.split(";").forEach((item$1) => {
28
- splitClassName(item$1).forEach((className) => {
27
+ value.split(";").forEach((item) => {
28
+ splitClassName(item).forEach((className) => {
29
29
  animatedClasses.add(className);
30
30
  });
31
31
  });
@@ -46,7 +46,7 @@ function analyseSVGStructure(svg, options = {}) {
46
46
  function gotReusableElement(item, isMask) {
47
47
  const element = item.node;
48
48
  const attribs = element.attribs;
49
- const index$1 = element._index;
49
+ const index = element._index;
50
50
  const id = attribs["id"];
51
51
  if (typeof id !== "string") {
52
52
  const message = `Definition element ${analyseTagError(element)} does not have id`;
@@ -67,7 +67,7 @@ function analyseSVGStructure(svg, options = {}) {
67
67
  element._reusableElement = {
68
68
  id,
69
69
  isMask,
70
- index: index$1
70
+ index
71
71
  };
72
72
  gotElementWithID(element, id, isMask);
73
73
  return true;
@@ -128,9 +128,9 @@ function analyseSVGStructure(svg, options = {}) {
128
128
  const parentBelongsTo = parentElement._belongsTo;
129
129
  if (parentBelongsTo) {
130
130
  const list = element._belongsTo || (element._belongsTo = []);
131
- parentBelongsTo.forEach((item$1) => {
132
- item$1.indexes.add(index);
133
- list.push(item$1);
131
+ parentBelongsTo.forEach((item) => {
132
+ item.indexes.add(index);
133
+ list.push(item);
134
134
  });
135
135
  }
136
136
  if (element._id === void 0) {
@@ -169,21 +169,21 @@ function analyseSVGStructure(svg, options = {}) {
169
169
  const id = item.id;
170
170
  if (ids[id]) return true;
171
171
  function fix() {
172
- const index$1 = item.usedByIndex;
173
- const element = elements.get(index$1);
172
+ const index = item.usedByIndex;
173
+ const element = elements.get(index);
174
174
  const tagName = element.tag;
175
175
  function remove() {
176
176
  const parentIndex = element._parentElement;
177
177
  const parent = typeof parentIndex === "number" ? elements.get(parentIndex) : null;
178
178
  if (parent) {
179
- if (parent._childElements) parent._childElements = parent._childElements.filter((num) => num !== index$1);
179
+ if (parent._childElements) parent._childElements = parent._childElements.filter((num) => num !== index);
180
180
  parent._belongsTo?.forEach((list) => {
181
- list.indexes.delete(index$1);
181
+ list.indexes.delete(index);
182
182
  });
183
183
  parent.children = parent.children.filter((node) => node !== element);
184
184
  }
185
185
  }
186
- if (element._linksTo) element._linksTo = element._linksTo.filter((item$1) => item$1.id !== id);
186
+ if (element._linksTo) element._linksTo = element._linksTo.filter((item) => item.id !== id);
187
187
  if (!element.children.length) {
188
188
  if (useTag.has(tagName)) {
189
189
  remove();
@@ -201,8 +201,8 @@ function analyseSVGStructure(svg, options = {}) {
201
201
  } else throw new Error(message);
202
202
  return false;
203
203
  });
204
- function hasChildItem(tree$1, child, canThrow) {
205
- const item = tree$1.children.find((item$1) => item$1.index === child.index && item$1.usedAsMask === child.usedAsMask);
204
+ function hasChildItem(tree, child, canThrow) {
205
+ const item = tree.children.find((item) => item.index === child.index && item.usedAsMask === child.usedAsMask);
206
206
  if (item && canThrow) throw new Error("Recursion");
207
207
  return !!item;
208
208
  }
@@ -211,9 +211,9 @@ function analyseSVGStructure(svg, options = {}) {
211
211
  usedAsMask: false,
212
212
  children: []
213
213
  };
214
- function parseTreeItem(tree$1, usedItems, inMask) {
215
- const element = elements.get(tree$1.index);
216
- if (tree$1.usedAsMask || inMask) {
214
+ function parseTreeItem(tree, usedItems, inMask) {
215
+ const element = elements.get(tree.index);
216
+ if (tree.usedAsMask || inMask) {
217
217
  element._usedAsMask = true;
218
218
  inMask = true;
219
219
  } else element._usedAsPaint = true;
@@ -225,9 +225,9 @@ function analyseSVGStructure(svg, options = {}) {
225
225
  index: childIndex,
226
226
  usedAsMask: false,
227
227
  children: [],
228
- parent: tree$1
228
+ parent: tree
229
229
  };
230
- tree$1.children.push(childItem);
230
+ tree.children.push(childItem);
231
231
  parseTreeItem(childItem, usedItems, inMask);
232
232
  });
233
233
  element._linksTo?.forEach((link) => {
@@ -237,10 +237,10 @@ function analyseSVGStructure(svg, options = {}) {
237
237
  index: linkIndex,
238
238
  usedAsMask,
239
239
  children: [],
240
- parent: tree$1
240
+ parent: tree
241
241
  };
242
- if (hasChildItem(tree$1, childItem, false)) return;
243
- tree$1.children.push(childItem);
242
+ if (hasChildItem(tree, childItem, false)) return;
243
+ tree.children.push(childItem);
244
244
  parseTreeItem(childItem, usedItems, inMask || usedAsMask);
245
245
  });
246
246
  }
@@ -61,7 +61,7 @@ function cleanupInlineStyle(svg) {
61
61
  return;
62
62
  }
63
63
  if (insideClipPathAttributes.has(prop)) {
64
- if (item.parents.find((item$1) => item$1.node.tag === "clipPath")) attribs[prop] = value;
64
+ if (item.parents.find((item) => item.node.tag === "clipPath")) attribs[prop] = value;
65
65
  return;
66
66
  }
67
67
  if (badSoftwareAttributes.has(prop) || badAttributePrefixes.has(prop.split("-").shift()) || knownIgnoredRules.has(prop) || knownIgnoredRules.has(partial)) return;
@@ -62,8 +62,8 @@ function cleanupSVGRoot(svg) {
62
62
  wrapper.children.push(child);
63
63
  continue;
64
64
  }
65
- const tagName$1 = child.tag;
66
- if (tagName$1 === "style" || tagName$1 === "title" || reusableElementsWithPalette.has(tagName$1) || maskTags.has(tagName$1)) root.children.push(child);
65
+ const tagName = child.tag;
66
+ if (tagName === "style" || tagName === "title" || reusableElementsWithPalette.has(tagName) || maskTags.has(tagName)) root.children.push(child);
67
67
  else wrapper.children.push(child);
68
68
  }
69
69
  root.children.push(wrapper);
package/lib/svg/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { iconToSVG, trimSVG } from "@iconify/utils";
1
+ import { iconToSVG, prettifySVG, trimSVG } from "@iconify/utils";
2
2
  import { parseXMLContent, stringifyXMLContent } from "@cyberalien/svg-utils";
3
3
  import { parseViewBox } from "@cyberalien/svg-utils/lib/svg/viewbox/parse.js";
4
4
 
@@ -26,20 +26,22 @@ var SVG = class {
26
26
  const value = data.attributes[key];
27
27
  svgAttributes += " " + key + "=\"" + value + "\"";
28
28
  }
29
- return "<svg" + svgAttributes + ">" + data.body + "</svg>";
29
+ const svg = "<svg" + svgAttributes + ">" + data.body + "</svg>";
30
+ return prettyPrint === true ? prettifySVG(svg) || svg : trimSVG(svg);
30
31
  }
31
32
  const $root = this.$svg;
32
33
  const attribs = $root.attribs;
33
34
  const box = this.viewBox;
34
35
  if (!attribs["viewBox"]) attribs["viewBox"] = `${box.left} ${box.top} ${box.width} ${box.height}`;
35
36
  for (const prop of ["width", "height"]) if (!attribs[prop]) attribs[prop] = box[prop];
36
- return stringifyXMLContent([$root], { prettyPrint });
37
+ const result = stringifyXMLContent([$root], { prettyPrint });
38
+ return prettyPrint === false ? trimSVG(result) : result;
37
39
  }
38
40
  /**
39
41
  * Get SVG as string without whitespaces
40
42
  */
41
43
  toMinifiedString(customisations) {
42
- return trimSVG(this.toString(customisations, false));
44
+ return this.toString(customisations, false);
43
45
  }
44
46
  /**
45
47
  * Get SVG as string with whitespaces
@@ -30,7 +30,7 @@ function parseSVGStyle(svg, callback) {
30
30
  }
31
31
  const tokens = getTokens(content);
32
32
  if (!(tokens instanceof Array)) throw new Error("Error parsing style. This parser can handle only basic CSS");
33
- let changed$1 = false;
33
+ let changed = false;
34
34
  const selectorStart = [];
35
35
  let newTokens = [];
36
36
  while (tokens.length) {
@@ -105,7 +105,7 @@ function parseSVGStyle(svg, callback) {
105
105
  assertNotOldCode(result);
106
106
  if (isAnimation) {
107
107
  if (result !== value) {
108
- changed$1 = true;
108
+ changed = true;
109
109
  token.value = result;
110
110
  }
111
111
  newTokens.push(token);
@@ -116,14 +116,14 @@ function parseSVGStyle(svg, callback) {
116
116
  newTokens.push(token);
117
117
  }
118
118
  } else {
119
- changed$1 = true;
119
+ changed = true;
120
120
  for (let i = 0; i < skipCount; i++) tokens.shift();
121
121
  }
122
122
  break;
123
123
  }
124
124
  case "rule": {
125
125
  const value = token.value;
126
- const selectorTokens = selectorStart.map((index) => newTokens[index]).filter((item$1) => item$1 !== null);
126
+ const selectorTokens = selectorStart.map((index) => newTokens[index]).filter((item) => item !== null);
127
127
  const result = callback({
128
128
  type: "global",
129
129
  prop: token.prop,
@@ -142,17 +142,17 @@ function parseSVGStyle(svg, callback) {
142
142
  if (result !== void 0) {
143
143
  assertNotOldCode(result);
144
144
  if (result !== value) {
145
- changed$1 = true;
145
+ changed = true;
146
146
  token.value = result;
147
147
  }
148
148
  newTokens.push(token);
149
- } else changed$1 = true;
149
+ } else changed = true;
150
150
  break;
151
151
  }
152
152
  default: assertNever(token);
153
153
  }
154
154
  }
155
- if (changed$1) {
155
+ if (changed) {
156
156
  const tree = tokensTree(newTokens.filter((token) => token !== null));
157
157
  if (!tree.length) item.removeNode = true;
158
158
  else node.children = [{
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.1",
6
+ "version": "5.0.3",
7
7
  "license": "MIT",
8
8
  "bugs": "https://github.com/iconify/tools/issues",
9
9
  "homepage": "https://github.com/iconify/tools",
@@ -14,7 +14,7 @@
14
14
  "module": "./lib/index.js",
15
15
  "types": "./lib/index.d.ts",
16
16
  "dependencies": {
17
- "@cyberalien/svg-utils": "^1.0.11",
17
+ "@cyberalien/svg-utils": "^1.1.1",
18
18
  "@iconify/types": "^2.0.0",
19
19
  "@iconify/utils": "^3.1.0",
20
20
  "fflate": "^0.8.2",
@@ -26,19 +26,19 @@
26
26
  "@eslint/eslintrc": "^3.3.3",
27
27
  "@eslint/js": "^9.39.2",
28
28
  "@types/jest": "^30.0.0",
29
- "@types/node": "^24.10.4",
30
- "@typescript-eslint/eslint-plugin": "^8.50.0",
31
- "@typescript-eslint/parser": "^8.50.0",
29
+ "@types/node": "^24.10.9",
30
+ "@typescript-eslint/eslint-plugin": "^8.54.0",
31
+ "@typescript-eslint/parser": "^8.54.0",
32
32
  "cross-env": "^10.1.0",
33
33
  "eslint": "^9.39.2",
34
34
  "eslint-config-prettier": "^10.1.8",
35
- "eslint-plugin-prettier": "^5.5.4",
35
+ "eslint-plugin-prettier": "^5.5.5",
36
36
  "globals": "^16.5.0",
37
- "prettier": "^3.7.4",
37
+ "prettier": "^3.8.1",
38
38
  "rimraf": "^6.1.2",
39
- "tsdown": "^0.18.0",
39
+ "tsdown": "^0.20.1",
40
40
  "typescript": "^5.9.3",
41
- "vitest": "^4.0.16"
41
+ "vitest": "^4.0.18"
42
42
  },
43
43
  "exports": {
44
44
  "./*": "./*",