@iconify/tools 4.0.6 → 4.1.1

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.
@@ -536,6 +536,9 @@ class IconSet {
536
536
  * Rename icon
537
537
  */
538
538
  rename(oldName, newName) {
539
+ if (oldName === newName) {
540
+ return false;
541
+ }
539
542
  const entries = this.entries;
540
543
  if (entries[newName]) {
541
544
  if (!this.remove(newName)) {
@@ -534,6 +534,9 @@ class IconSet {
534
534
  * Rename icon
535
535
  */
536
536
  rename(oldName, newName) {
537
+ if (oldName === newName) {
538
+ return false;
539
+ }
537
540
  const entries = this.entries;
538
541
  if (entries[newName]) {
539
542
  if (!this.remove(newName)) {
@@ -125,15 +125,18 @@ async function figmaImagesQuery(options, nodes, cache) {
125
125
  if (options.version) {
126
126
  params.set("version", options.version);
127
127
  }
128
- if (svgOptions.includeID) {
129
- params.set("svg_include_id", "true");
130
- }
131
- if (svgOptions.simplifyStroke) {
132
- params.set("svg_simplify_stroke", "true");
133
- }
134
- if (svgOptions.useAbsoluteBounds) {
135
- params.set("use_absolute_bounds", "true");
136
- }
128
+ params.set(
129
+ "svg_include_id",
130
+ svgOptions.includeID ? "true" : "false"
131
+ );
132
+ params.set(
133
+ "svg_simplify_stroke",
134
+ svgOptions.simplifyStroke ? "true" : "false"
135
+ );
136
+ params.set(
137
+ "use_absolute_bounds",
138
+ svgOptions.useAbsoluteBounds ? "true" : "false"
139
+ );
137
140
  download_api_index.sendAPIQuery(
138
141
  {
139
142
  uri,
@@ -123,15 +123,18 @@ async function figmaImagesQuery(options, nodes, cache) {
123
123
  if (options.version) {
124
124
  params.set("version", options.version);
125
125
  }
126
- if (svgOptions.includeID) {
127
- params.set("svg_include_id", "true");
128
- }
129
- if (svgOptions.simplifyStroke) {
130
- params.set("svg_simplify_stroke", "true");
131
- }
132
- if (svgOptions.useAbsoluteBounds) {
133
- params.set("use_absolute_bounds", "true");
134
- }
126
+ params.set(
127
+ "svg_include_id",
128
+ svgOptions.includeID ? "true" : "false"
129
+ );
130
+ params.set(
131
+ "svg_simplify_stroke",
132
+ svgOptions.simplifyStroke ? "true" : "false"
133
+ );
134
+ params.set(
135
+ "use_absolute_bounds",
136
+ svgOptions.useAbsoluteBounds ? "true" : "false"
137
+ );
135
138
  sendAPIQuery(
136
139
  {
137
140
  uri,
package/lib/misc/scan.cjs CHANGED
@@ -30,7 +30,12 @@ async function scanDirectory(path, callback, subdirs = true) {
30
30
  if (isHidden(filename)) {
31
31
  continue;
32
32
  }
33
- const stat = await fs.promises.stat(path + subdir + filename);
33
+ let stat;
34
+ try {
35
+ stat = await fs.promises.stat(path + subdir + filename);
36
+ } catch (err) {
37
+ continue;
38
+ }
34
39
  if (stat.isDirectory()) {
35
40
  if (subdirs) {
36
41
  await scan(subdir + filename + "/");
package/lib/misc/scan.mjs CHANGED
@@ -28,7 +28,12 @@ async function scanDirectory(path, callback, subdirs = true) {
28
28
  if (isHidden(filename)) {
29
29
  continue;
30
30
  }
31
- const stat = await promises.stat(path + subdir + filename);
31
+ let stat;
32
+ try {
33
+ stat = await promises.stat(path + subdir + filename);
34
+ } catch (err) {
35
+ continue;
36
+ }
32
37
  if (stat.isDirectory()) {
33
38
  if (subdirs) {
34
39
  await scan(subdir + filename + "/");
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": "4.0.6",
6
+ "version": "4.1.1",
7
7
  "license": "MIT",
8
8
  "bugs": "https://github.com/iconify/tools/issues",
9
9
  "homepage": "https://github.com/iconify/tools",
@@ -16,31 +16,31 @@
16
16
  "types": "./lib/index.d.ts",
17
17
  "dependencies": {
18
18
  "@iconify/types": "^2.0.0",
19
- "@iconify/utils": "^2.1.32",
19
+ "@iconify/utils": "^2.2.0",
20
20
  "@types/tar": "^6.1.13",
21
- "axios": "^1.7.7",
21
+ "axios": "^1.7.9",
22
22
  "cheerio": "1.0.0",
23
23
  "domhandler": "^5.0.3",
24
24
  "extract-zip": "^2.0.1",
25
- "local-pkg": "^0.5.0",
25
+ "local-pkg": "^0.5.1",
26
26
  "pathe": "^1.1.2",
27
27
  "svgo": "^3.3.2",
28
28
  "tar": "^6.2.1"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/jest": "^29.5.12",
32
- "@types/node": "^20.16.2",
31
+ "@types/jest": "^29.5.14",
32
+ "@types/node": "^20.17.9",
33
33
  "@typescript-eslint/eslint-plugin": "^6.21.0",
34
34
  "@typescript-eslint/parser": "^6.21.0",
35
35
  "cross-env": "^7.0.3",
36
- "eslint": "^8.57.0",
36
+ "eslint": "^8.57.1",
37
37
  "eslint-config-prettier": "^9.1.0",
38
38
  "eslint-plugin-prettier": "^5.2.1",
39
39
  "jest": "^29.7.0",
40
- "prettier": "^3.3.3",
40
+ "prettier": "^3.4.2",
41
41
  "rimraf": "^6.0.1",
42
42
  "ts-jest": "^29.2.5",
43
- "typescript": "^5.5.4",
43
+ "typescript": "^5.7.2",
44
44
  "unbuild": "^2.0.0"
45
45
  },
46
46
  "exports": {