@iconify/tools 2.2.0-beta.4 → 2.2.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.
@@ -226,6 +226,7 @@ async function parseColors(svg, options = {}) {
226
226
  const newValue = await checkColor(
227
227
  elementProp,
228
228
  value
229
+ // Do not pass third parameter
229
230
  );
230
231
  if (newValue !== value) {
231
232
  updatedValues = true;
@@ -224,6 +224,7 @@ async function parseColors(svg, options = {}) {
224
224
  const newValue = await checkColor(
225
225
  elementProp,
226
226
  value
227
+ // Do not pass third parameter
227
228
  );
228
229
  if (newValue !== value) {
229
230
  updatedValues = true;
@@ -58,6 +58,7 @@ async function downloadGitRepo(options) {
58
58
  }
59
59
  const target = options.target = await export_helpers_prepare.prepareDirectoryForExport({
60
60
  ...options,
61
+ // Always cleanup
61
62
  cleanup: true
62
63
  });
63
64
  if (options.log) {
@@ -56,6 +56,7 @@ async function downloadGitRepo(options) {
56
56
  }
57
57
  const target = options.target = await prepareDirectoryForExport({
58
58
  ...options,
59
+ // Always cleanup
59
60
  cleanup: true
60
61
  });
61
62
  if (options.log) {
@@ -72,7 +72,13 @@ async function downloadGitHubRepo(options) {
72
72
  const filename = rootDir + "/" + files[i];
73
73
  const stat = await fs.promises.lstat(filename);
74
74
  const isDir = stat.isDirectory();
75
- if (stat.isSymbolicLink() || isDir && filename.slice(0 - hashSearch.length) === hashSearch || isDir && options.cleanupOldDirectories !== false || !isDir && options.cleanupOldFiles) {
75
+ if (
76
+ // Remove symbolic links
77
+ stat.isSymbolicLink() || // Remove if directory matches hash to avoid errors extracting zip
78
+ isDir && filename.slice(0 - hashSearch.length) === hashSearch || // Remove if directory and cleanupOldDirectories is not disabled
79
+ isDir && options.cleanupOldDirectories !== false || // Remove if file and cleanupOldFiles is enabled
80
+ !isDir && options.cleanupOldFiles
81
+ ) {
76
82
  try {
77
83
  await fs.promises.rm(filename, {
78
84
  force: true,
@@ -70,7 +70,13 @@ async function downloadGitHubRepo(options) {
70
70
  const filename = rootDir + "/" + files[i];
71
71
  const stat = await promises.lstat(filename);
72
72
  const isDir = stat.isDirectory();
73
- if (stat.isSymbolicLink() || isDir && filename.slice(0 - hashSearch.length) === hashSearch || isDir && options.cleanupOldDirectories !== false || !isDir && options.cleanupOldFiles) {
73
+ if (
74
+ // Remove symbolic links
75
+ stat.isSymbolicLink() || // Remove if directory matches hash to avoid errors extracting zip
76
+ isDir && filename.slice(0 - hashSearch.length) === hashSearch || // Remove if directory and cleanupOldDirectories is not disabled
77
+ isDir && options.cleanupOldDirectories !== false || // Remove if file and cleanupOldFiles is enabled
78
+ !isDir && options.cleanupOldFiles
79
+ ) {
74
80
  try {
75
81
  await promises.rm(filename, {
76
82
  force: true,
@@ -72,7 +72,13 @@ async function downloadGitLabRepo(options) {
72
72
  const filename = rootDir + "/" + files[i];
73
73
  const stat = await fs.promises.lstat(filename);
74
74
  const isDir = stat.isDirectory();
75
- if (stat.isSymbolicLink() || isDir && filename.slice(0 - hashSearch.length) === hashSearch || isDir && options.cleanupOldDirectories !== false || !isDir && options.cleanupOldFiles) {
75
+ if (
76
+ // Remove symbolic links
77
+ stat.isSymbolicLink() || // Remove if directory matches hash to avoid errors extracting zip
78
+ isDir && filename.slice(0 - hashSearch.length) === hashSearch || // Remove if directory and cleanupOldDirectories is not disabled
79
+ isDir && options.cleanupOldDirectories !== false || // Remove if file and cleanupOldFiles is enabled
80
+ !isDir && options.cleanupOldFiles
81
+ ) {
76
82
  try {
77
83
  await fs.promises.rm(filename, {
78
84
  force: true,
@@ -70,7 +70,13 @@ async function downloadGitLabRepo(options) {
70
70
  const filename = rootDir + "/" + files[i];
71
71
  const stat = await promises.lstat(filename);
72
72
  const isDir = stat.isDirectory();
73
- if (stat.isSymbolicLink() || isDir && filename.slice(0 - hashSearch.length) === hashSearch || isDir && options.cleanupOldDirectories !== false || !isDir && options.cleanupOldFiles) {
73
+ if (
74
+ // Remove symbolic links
75
+ stat.isSymbolicLink() || // Remove if directory matches hash to avoid errors extracting zip
76
+ isDir && filename.slice(0 - hashSearch.length) === hashSearch || // Remove if directory and cleanupOldDirectories is not disabled
77
+ isDir && options.cleanupOldDirectories !== false || // Remove if file and cleanupOldFiles is enabled
78
+ !isDir && options.cleanupOldFiles
79
+ ) {
74
80
  try {
75
81
  await promises.rm(filename, {
76
82
  force: true,
@@ -45,6 +45,7 @@ async function exportIconPackage(iconSet, options) {
45
45
  ...customPackageProps,
46
46
  dependencies: dependencies || {
47
47
  "@iconify/types": "*"
48
+ // '^' + (await getTypesVersion()),
48
49
  }
49
50
  };
50
51
  await misc_writeJson.writeJSONFile(dir + "/package.json", packageJSON);
@@ -43,6 +43,7 @@ async function exportIconPackage(iconSet, options) {
43
43
  ...customPackageProps,
44
44
  dependencies: dependencies || {
45
45
  "@iconify/types": "*"
46
+ // '^' + (await getTypesVersion()),
46
47
  }
47
48
  };
48
49
  await writeJSONFile(dir + "/package.json", packageJSON);
@@ -75,6 +75,7 @@ async function exportJSONPackage(iconSet, options) {
75
75
  iconSet: packageJSONIconSet,
76
76
  dependencies: dependencies || {
77
77
  "@iconify/types": "*"
78
+ // '^' + (await getTypesVersion()),
78
79
  }
79
80
  };
80
81
  const dtsContent = [];
@@ -73,6 +73,7 @@ async function exportJSONPackage(iconSet, options) {
73
73
  iconSet: packageJSONIconSet,
74
74
  dependencies: dependencies || {
75
75
  "@iconify/types": "*"
76
+ // '^' + (await getTypesVersion()),
76
77
  }
77
78
  };
78
79
  const dtsContent = [];
@@ -17,9 +17,15 @@ function sortThemeKeys(keys) {
17
17
  );
18
18
  }
19
19
  class IconSet {
20
+ /**
21
+ * Load icon set
22
+ */
20
23
  constructor(data) {
21
24
  this.load(data);
22
25
  }
26
+ /**
27
+ * Load icon set
28
+ */
23
29
  load(data) {
24
30
  this.prefix = data.prefix;
25
31
  const defaultProps = iconSet_props.filterProps(data, defaults.defaultIconDimensions, true);
@@ -129,15 +135,27 @@ class IconSet {
129
135
  });
130
136
  this.lastModified = data.lastModified || 0;
131
137
  }
138
+ /**
139
+ * Update last modification time
140
+ */
132
141
  updateLastModified(value) {
133
142
  this.lastModified = value || Math.floor(Date.now() / 1e3);
134
143
  }
144
+ /**
145
+ * List icons
146
+ */
135
147
  list(types = ["icon", "variation"]) {
136
148
  return Object.keys(this.entries).filter((name) => {
137
149
  const type = this.entries[name].type;
138
150
  return types.indexOf(type) !== -1;
139
151
  });
140
152
  }
153
+ /**
154
+ * forEach function to loop through all entries.
155
+ * Supports asynchronous callbacks.
156
+ *
157
+ * Callback should return false to stop loop.
158
+ */
141
159
  async forEach(callback, types = ["icon", "variation", "alias"]) {
142
160
  const names = this.list(types);
143
161
  for (let i = 0; i < names.length; i++) {
@@ -154,6 +172,17 @@ class IconSet {
154
172
  }
155
173
  }
156
174
  }
175
+ /**
176
+ * Get parent icons tree
177
+ *
178
+ * Returns parent icons list for each icon, null if failed to resolve.
179
+ * In parent icons list, first element is a direct parent, last is icon. Does not include item.
180
+ *
181
+ * Examples:
182
+ * 'alias3': ['alias2', 'alias1', 'icon']
183
+ * 'icon': []
184
+ * 'bad-icon': null
185
+ */
157
186
  getTree(names) {
158
187
  const entries = this.entries;
159
188
  const resolved = /* @__PURE__ */ Object.create(null);
@@ -200,6 +229,9 @@ class IconSet {
200
229
  tree.forEach(parse);
201
230
  return result && full ? { ...defaults.defaultIconProps, ...result } : result;
202
231
  }
232
+ /**
233
+ * Generate HTML
234
+ */
203
235
  toString(name, customisations = {
204
236
  width: "auto",
205
237
  height: "auto"
@@ -214,10 +246,16 @@ class IconSet {
214
246
  ).join("");
215
247
  return `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"${attributes}>${result.body}</svg>`;
216
248
  }
249
+ /**
250
+ * Get SVG instance for icon
251
+ */
217
252
  toSVG(name) {
218
253
  const html = this.toString(name);
219
254
  return html ? new svg_index.SVG(html) : null;
220
255
  }
256
+ /**
257
+ * Export icon set
258
+ */
221
259
  export(validate = true) {
222
260
  const icons = /* @__PURE__ */ Object.create(null);
223
261
  const aliases = /* @__PURE__ */ Object.create(null);
@@ -304,6 +342,9 @@ class IconSet {
304
342
  minify.minifyIconSet(result);
305
343
  return result;
306
344
  }
345
+ /**
346
+ * Get characters map
347
+ */
307
348
  chars(names) {
308
349
  const chars = /* @__PURE__ */ Object.create(null);
309
350
  if (!names) {
@@ -318,6 +359,9 @@ class IconSet {
318
359
  }
319
360
  return chars;
320
361
  }
362
+ /**
363
+ * Filter icons
364
+ */
321
365
  _filter(callback) {
322
366
  const names = [];
323
367
  for (const key in this.entries) {
@@ -341,6 +385,9 @@ class IconSet {
341
385
  }
342
386
  return names;
343
387
  }
388
+ /**
389
+ * Count icons
390
+ */
344
391
  count() {
345
392
  return this._filter((_key, item, icon) => {
346
393
  if (item.type === "alias" || item.props.hidden || icon?.hidden) {
@@ -349,6 +396,9 @@ class IconSet {
349
396
  return true;
350
397
  }).length;
351
398
  }
399
+ /**
400
+ * Find category by title
401
+ */
352
402
  findCategory(title, add) {
353
403
  const categoryItem = Array.from(this.categories).find(
354
404
  (item) => item.title === title
@@ -366,6 +416,11 @@ class IconSet {
366
416
  }
367
417
  return null;
368
418
  }
419
+ /**
420
+ * Count icons in category, remove category if empty
421
+ *
422
+ * Hidden icons and aliases do not count
423
+ */
369
424
  listCategory(category) {
370
425
  const categoryItem = typeof category === "string" ? this.findCategory(category, false) : category;
371
426
  if (!categoryItem) {
@@ -385,9 +440,17 @@ class IconSet {
385
440
  }
386
441
  return icons;
387
442
  }
443
+ /**
444
+ * Check if icon exists
445
+ */
388
446
  exists(name) {
389
447
  return !!this.entries[name];
390
448
  }
449
+ /**
450
+ * Remove icons. Returns number of removed icons
451
+ *
452
+ * If removeDependencies is a string, it represents new parent for all aliases of removed icon. New parent cannot be alias or variation.
453
+ */
391
454
  remove(name, removeDependencies = true) {
392
455
  const entries = this.entries;
393
456
  if (typeof removeDependencies === "string") {
@@ -430,6 +493,9 @@ class IconSet {
430
493
  }
431
494
  return count;
432
495
  }
496
+ /**
497
+ * Remove icon
498
+ */
433
499
  rename(oldName, newName) {
434
500
  const entries = this.entries;
435
501
  if (entries[newName]) {
@@ -458,6 +524,9 @@ class IconSet {
458
524
  this.updateLastModified();
459
525
  return true;
460
526
  }
527
+ /**
528
+ * Add/update item
529
+ */
461
530
  setItem(name, item) {
462
531
  switch (item.type) {
463
532
  case "alias":
@@ -471,6 +540,9 @@ class IconSet {
471
540
  this.updateLastModified();
472
541
  return true;
473
542
  }
543
+ /**
544
+ * Add/update icon
545
+ */
474
546
  setIcon(name, icon) {
475
547
  return this.setItem(name, {
476
548
  type: "icon",
@@ -480,6 +552,9 @@ class IconSet {
480
552
  categories: /* @__PURE__ */ new Set()
481
553
  });
482
554
  }
555
+ /**
556
+ * Add/update alias without props
557
+ */
483
558
  setAlias(name, parent) {
484
559
  return this.setItem(name, {
485
560
  type: "alias",
@@ -487,6 +562,9 @@ class IconSet {
487
562
  chars: /* @__PURE__ */ new Set()
488
563
  });
489
564
  }
565
+ /**
566
+ * Add/update alias with props
567
+ */
490
568
  setVariation(name, parent, props) {
491
569
  return this.setItem(name, {
492
570
  type: "variation",
@@ -495,6 +573,9 @@ class IconSet {
495
573
  chars: /* @__PURE__ */ new Set()
496
574
  });
497
575
  }
576
+ /**
577
+ * Icon from SVG. Updates old icon if it exists
578
+ */
498
579
  fromSVG(name, svg) {
499
580
  const props = { ...svg.viewBox };
500
581
  const body = svg.getBody();
@@ -516,6 +597,9 @@ class IconSet {
516
597
  ...props
517
598
  });
518
599
  }
600
+ /**
601
+ * Add or remove character for icon
602
+ */
519
603
  toggleCharacter(iconName, char, add) {
520
604
  const item = this.entries[iconName];
521
605
  if (!item) {
@@ -527,6 +611,9 @@ class IconSet {
527
611
  }
528
612
  return false;
529
613
  }
614
+ /**
615
+ * Add or remove category for icon
616
+ */
530
617
  toggleCategory(iconName, category, add) {
531
618
  const item = this.entries[iconName];
532
619
  const categoryItem = this.findCategory(category, add);
@@ -543,6 +630,9 @@ class IconSet {
543
630
  }
544
631
  return false;
545
632
  }
633
+ /**
634
+ * Find icons that belong to theme
635
+ */
546
636
  checkTheme(prefix) {
547
637
  const themes = prefix ? this.prefixes : this.suffixes;
548
638
  const keys = sortThemeKeys(Object.keys(themes));
@@ -15,9 +15,15 @@ function sortThemeKeys(keys) {
15
15
  );
16
16
  }
17
17
  class IconSet {
18
+ /**
19
+ * Load icon set
20
+ */
18
21
  constructor(data) {
19
22
  this.load(data);
20
23
  }
24
+ /**
25
+ * Load icon set
26
+ */
21
27
  load(data) {
22
28
  this.prefix = data.prefix;
23
29
  const defaultProps = filterProps(data, defaultIconDimensions, true);
@@ -127,15 +133,27 @@ class IconSet {
127
133
  });
128
134
  this.lastModified = data.lastModified || 0;
129
135
  }
136
+ /**
137
+ * Update last modification time
138
+ */
130
139
  updateLastModified(value) {
131
140
  this.lastModified = value || Math.floor(Date.now() / 1e3);
132
141
  }
142
+ /**
143
+ * List icons
144
+ */
133
145
  list(types = ["icon", "variation"]) {
134
146
  return Object.keys(this.entries).filter((name) => {
135
147
  const type = this.entries[name].type;
136
148
  return types.indexOf(type) !== -1;
137
149
  });
138
150
  }
151
+ /**
152
+ * forEach function to loop through all entries.
153
+ * Supports asynchronous callbacks.
154
+ *
155
+ * Callback should return false to stop loop.
156
+ */
139
157
  async forEach(callback, types = ["icon", "variation", "alias"]) {
140
158
  const names = this.list(types);
141
159
  for (let i = 0; i < names.length; i++) {
@@ -152,6 +170,17 @@ class IconSet {
152
170
  }
153
171
  }
154
172
  }
173
+ /**
174
+ * Get parent icons tree
175
+ *
176
+ * Returns parent icons list for each icon, null if failed to resolve.
177
+ * In parent icons list, first element is a direct parent, last is icon. Does not include item.
178
+ *
179
+ * Examples:
180
+ * 'alias3': ['alias2', 'alias1', 'icon']
181
+ * 'icon': []
182
+ * 'bad-icon': null
183
+ */
155
184
  getTree(names) {
156
185
  const entries = this.entries;
157
186
  const resolved = /* @__PURE__ */ Object.create(null);
@@ -198,6 +227,9 @@ class IconSet {
198
227
  tree.forEach(parse);
199
228
  return result && full ? { ...defaultIconProps, ...result } : result;
200
229
  }
230
+ /**
231
+ * Generate HTML
232
+ */
201
233
  toString(name, customisations = {
202
234
  width: "auto",
203
235
  height: "auto"
@@ -212,10 +244,16 @@ class IconSet {
212
244
  ).join("");
213
245
  return `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"${attributes}>${result.body}</svg>`;
214
246
  }
247
+ /**
248
+ * Get SVG instance for icon
249
+ */
215
250
  toSVG(name) {
216
251
  const html = this.toString(name);
217
252
  return html ? new SVG(html) : null;
218
253
  }
254
+ /**
255
+ * Export icon set
256
+ */
219
257
  export(validate = true) {
220
258
  const icons = /* @__PURE__ */ Object.create(null);
221
259
  const aliases = /* @__PURE__ */ Object.create(null);
@@ -302,6 +340,9 @@ class IconSet {
302
340
  minifyIconSet(result);
303
341
  return result;
304
342
  }
343
+ /**
344
+ * Get characters map
345
+ */
305
346
  chars(names) {
306
347
  const chars = /* @__PURE__ */ Object.create(null);
307
348
  if (!names) {
@@ -316,6 +357,9 @@ class IconSet {
316
357
  }
317
358
  return chars;
318
359
  }
360
+ /**
361
+ * Filter icons
362
+ */
319
363
  _filter(callback) {
320
364
  const names = [];
321
365
  for (const key in this.entries) {
@@ -339,6 +383,9 @@ class IconSet {
339
383
  }
340
384
  return names;
341
385
  }
386
+ /**
387
+ * Count icons
388
+ */
342
389
  count() {
343
390
  return this._filter((_key, item, icon) => {
344
391
  if (item.type === "alias" || item.props.hidden || icon?.hidden) {
@@ -347,6 +394,9 @@ class IconSet {
347
394
  return true;
348
395
  }).length;
349
396
  }
397
+ /**
398
+ * Find category by title
399
+ */
350
400
  findCategory(title, add) {
351
401
  const categoryItem = Array.from(this.categories).find(
352
402
  (item) => item.title === title
@@ -364,6 +414,11 @@ class IconSet {
364
414
  }
365
415
  return null;
366
416
  }
417
+ /**
418
+ * Count icons in category, remove category if empty
419
+ *
420
+ * Hidden icons and aliases do not count
421
+ */
367
422
  listCategory(category) {
368
423
  const categoryItem = typeof category === "string" ? this.findCategory(category, false) : category;
369
424
  if (!categoryItem) {
@@ -383,9 +438,17 @@ class IconSet {
383
438
  }
384
439
  return icons;
385
440
  }
441
+ /**
442
+ * Check if icon exists
443
+ */
386
444
  exists(name) {
387
445
  return !!this.entries[name];
388
446
  }
447
+ /**
448
+ * Remove icons. Returns number of removed icons
449
+ *
450
+ * If removeDependencies is a string, it represents new parent for all aliases of removed icon. New parent cannot be alias or variation.
451
+ */
389
452
  remove(name, removeDependencies = true) {
390
453
  const entries = this.entries;
391
454
  if (typeof removeDependencies === "string") {
@@ -428,6 +491,9 @@ class IconSet {
428
491
  }
429
492
  return count;
430
493
  }
494
+ /**
495
+ * Remove icon
496
+ */
431
497
  rename(oldName, newName) {
432
498
  const entries = this.entries;
433
499
  if (entries[newName]) {
@@ -456,6 +522,9 @@ class IconSet {
456
522
  this.updateLastModified();
457
523
  return true;
458
524
  }
525
+ /**
526
+ * Add/update item
527
+ */
459
528
  setItem(name, item) {
460
529
  switch (item.type) {
461
530
  case "alias":
@@ -469,6 +538,9 @@ class IconSet {
469
538
  this.updateLastModified();
470
539
  return true;
471
540
  }
541
+ /**
542
+ * Add/update icon
543
+ */
472
544
  setIcon(name, icon) {
473
545
  return this.setItem(name, {
474
546
  type: "icon",
@@ -478,6 +550,9 @@ class IconSet {
478
550
  categories: /* @__PURE__ */ new Set()
479
551
  });
480
552
  }
553
+ /**
554
+ * Add/update alias without props
555
+ */
481
556
  setAlias(name, parent) {
482
557
  return this.setItem(name, {
483
558
  type: "alias",
@@ -485,6 +560,9 @@ class IconSet {
485
560
  chars: /* @__PURE__ */ new Set()
486
561
  });
487
562
  }
563
+ /**
564
+ * Add/update alias with props
565
+ */
488
566
  setVariation(name, parent, props) {
489
567
  return this.setItem(name, {
490
568
  type: "variation",
@@ -493,6 +571,9 @@ class IconSet {
493
571
  chars: /* @__PURE__ */ new Set()
494
572
  });
495
573
  }
574
+ /**
575
+ * Icon from SVG. Updates old icon if it exists
576
+ */
496
577
  fromSVG(name, svg) {
497
578
  const props = { ...svg.viewBox };
498
579
  const body = svg.getBody();
@@ -514,6 +595,9 @@ class IconSet {
514
595
  ...props
515
596
  });
516
597
  }
598
+ /**
599
+ * Add or remove character for icon
600
+ */
517
601
  toggleCharacter(iconName, char, add) {
518
602
  const item = this.entries[iconName];
519
603
  if (!item) {
@@ -525,6 +609,9 @@ class IconSet {
525
609
  }
526
610
  return false;
527
611
  }
612
+ /**
613
+ * Add or remove category for icon
614
+ */
528
615
  toggleCategory(iconName, category, add) {
529
616
  const item = this.entries[iconName];
530
617
  const categoryItem = this.findCategory(category, add);
@@ -541,6 +628,9 @@ class IconSet {
541
628
  }
542
629
  return false;
543
630
  }
631
+ /**
632
+ * Find icons that belong to theme
633
+ */
544
634
  checkTheme(prefix) {
545
635
  const themes = prefix ? this.prefixes : this.suffixes;
546
636
  const keys = sortThemeKeys(Object.keys(themes));
@@ -42,10 +42,12 @@ require('../../misc/scan.cjs');
42
42
 
43
43
  async function importFromFigma(options) {
44
44
  const cacheOptions = options.cacheDir ? {
45
+ // 24 hours
45
46
  ttl: options.cacheAPITTL || 60 * 60 * 24,
46
47
  dir: options.cacheDir
47
48
  } : void 0;
48
49
  const cacheSVGOptions = options.cacheDir ? {
50
+ // 30 days
49
51
  ttl: options.cacheSVGTTL || 60 * 60 * 24 * 30,
50
52
  dir: options.cacheDir
51
53
  } : void 0;
@@ -93,12 +95,15 @@ async function importFromFigma(options) {
93
95
  }
94
96
  }
95
97
  const result = {
98
+ // Document
96
99
  name: document.name,
97
100
  version: document.version,
98
101
  lastModified: document.lastModified,
102
+ // Counters
99
103
  nodesCount: nodes.nodesCount,
100
104
  generatedIconsCount: nodes.generatedIconsCount,
101
105
  downloadedIconsCount: nodes.downloadedIconsCount,
106
+ // Icon set
102
107
  iconSet,
103
108
  missing
104
109
  };
@@ -40,10 +40,12 @@ import '../../misc/scan.mjs';
40
40
 
41
41
  async function importFromFigma(options) {
42
42
  const cacheOptions = options.cacheDir ? {
43
+ // 24 hours
43
44
  ttl: options.cacheAPITTL || 60 * 60 * 24,
44
45
  dir: options.cacheDir
45
46
  } : void 0;
46
47
  const cacheSVGOptions = options.cacheDir ? {
48
+ // 30 days
47
49
  ttl: options.cacheSVGTTL || 60 * 60 * 24 * 30,
48
50
  dir: options.cacheDir
49
51
  } : void 0;
@@ -91,12 +93,15 @@ async function importFromFigma(options) {
91
93
  }
92
94
  }
93
95
  const result = {
96
+ // Document
94
97
  name: document.name,
95
98
  version: document.version,
96
99
  lastModified: document.lastModified,
100
+ // Counters
97
101
  nodesCount: nodes.nodesCount,
98
102
  generatedIconsCount: nodes.generatedIconsCount,
99
103
  downloadedIconsCount: nodes.downloadedIconsCount,
104
+ // Icon set
100
105
  iconSet,
101
106
  missing
102
107
  };