@iconify/tools 4.0.7 → 4.1.2

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)) {
@@ -17,6 +17,8 @@ declare const sizeTags: {
17
17
  };
18
18
  /**
19
19
  * Add tags to icon set
20
+ *
21
+ * @deprecated
20
22
  */
21
23
  declare function addTagsToIconSet(iconSet: IconSet, customTags?: string[]): string[];
22
24
 
@@ -17,6 +17,8 @@ declare const sizeTags: {
17
17
  };
18
18
  /**
19
19
  * Add tags to icon set
20
+ *
21
+ * @deprecated
20
22
  */
21
23
  declare function addTagsToIconSet(iconSet: IconSet, customTags?: string[]): string[];
22
24
 
@@ -17,6 +17,8 @@ declare const sizeTags: {
17
17
  };
18
18
  /**
19
19
  * Add tags to icon set
20
+ *
21
+ * @deprecated
20
22
  */
21
23
  declare function addTagsToIconSet(iconSet: IconSet, customTags?: string[]): string[];
22
24
 
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 + "/");
@@ -71,7 +76,12 @@ function scanDirectorySync(path, callback, subdirs = true) {
71
76
  if (isHidden(filename)) {
72
77
  continue;
73
78
  }
74
- const stat = fs.statSync(path + subdir + filename);
79
+ let stat;
80
+ try {
81
+ stat = fs.statSync(path + subdir + filename);
82
+ } catch (err) {
83
+ continue;
84
+ }
75
85
  if (stat.isDirectory()) {
76
86
  if (subdirs) {
77
87
  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 + "/");
@@ -69,7 +74,12 @@ function scanDirectorySync(path, callback, subdirs = true) {
69
74
  if (isHidden(filename)) {
70
75
  continue;
71
76
  }
72
- const stat = statSync(path + subdir + filename);
77
+ let stat;
78
+ try {
79
+ stat = statSync(path + subdir + filename);
80
+ } catch (err) {
81
+ continue;
82
+ }
73
83
  if (stat.isDirectory()) {
74
84
  if (subdirs) {
75
85
  scan(subdir + filename + "/");
package/license.txt CHANGED
File without changes