@iconify/tools 5.0.0-beta.5 → 5.0.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.
|
@@ -44,7 +44,7 @@ async function getAPICache(dir, key) {
|
|
|
44
44
|
try {
|
|
45
45
|
const content = JSON.parse(await promises.readFile(item.filename, "utf8"));
|
|
46
46
|
return content.version === cacheVersion && content.expires > time ? content.data : null;
|
|
47
|
-
} catch
|
|
47
|
+
} catch {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -63,7 +63,7 @@ async function getStoredFiles(dir, clear = false) {
|
|
|
63
63
|
storedFiles[dir] = storage;
|
|
64
64
|
try {
|
|
65
65
|
await promises.mkdir(dir, { recursive: true });
|
|
66
|
-
} catch
|
|
66
|
+
} catch {}
|
|
67
67
|
await scanDirectory(dir, async (ext, file, subdir, path) => {
|
|
68
68
|
if (ext !== ".json") return false;
|
|
69
69
|
const filename = path + subdir + file + ext;
|
|
@@ -16,7 +16,7 @@ async function downloadNPMPackage(options) {
|
|
|
16
16
|
else expectedVersion = null;
|
|
17
17
|
else expectedVersion = ifModifiedSince === true ? await getPackageVersion(contentsDir) : ifModifiedSince;
|
|
18
18
|
if (version === expectedVersion) return "not_modified";
|
|
19
|
-
} catch
|
|
19
|
+
} catch {
|
|
20
20
|
options.cleanup = true;
|
|
21
21
|
}
|
|
22
22
|
const archiveURL = versionInfo.file;
|
|
@@ -26,7 +26,7 @@ async function downloadNPMPackage(options) {
|
|
|
26
26
|
let archiveExists = false;
|
|
27
27
|
try {
|
|
28
28
|
archiveExists = (await promises.stat(archiveTarget)).isFile();
|
|
29
|
-
} catch
|
|
29
|
+
} catch {}
|
|
30
30
|
if (!archiveExists) {
|
|
31
31
|
if (options.log) console.log(`Downloading ${archiveURL}`);
|
|
32
32
|
await downloadFile({
|
|
@@ -11,7 +11,7 @@ async function exportCustomFiles(dir, options, result) {
|
|
|
11
11
|
if (content === null) {
|
|
12
12
|
try {
|
|
13
13
|
await promises.unlink(dir + "/" + filename);
|
|
14
|
-
} catch
|
|
14
|
+
} catch {}
|
|
15
15
|
continue;
|
|
16
16
|
}
|
|
17
17
|
if (typeof content === "string") await promises.writeFile(dir + "/" + filename, content, "utf8");
|
|
@@ -164,12 +164,16 @@ async function figmaDownloadImages(nodes, cache) {
|
|
|
164
164
|
callback: (index) => {
|
|
165
165
|
return new Promise((resolve, reject) => {
|
|
166
166
|
const item = filtered[index];
|
|
167
|
-
sendAPIQuery({ uri: item.url }, cache).then((
|
|
168
|
-
if (
|
|
167
|
+
sendAPIQuery({ uri: item.url }, cache).then((response) => {
|
|
168
|
+
if (!response.success) {
|
|
169
|
+
reject(response.error);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (typeof response.content === "string") {
|
|
169
173
|
count++;
|
|
170
|
-
item.content =
|
|
174
|
+
item.content = response.content;
|
|
171
175
|
resolve(void 0);
|
|
172
|
-
} else reject(
|
|
176
|
+
} else reject(response.content);
|
|
173
177
|
}).catch(reject);
|
|
174
178
|
});
|
|
175
179
|
},
|
package/package.json
CHANGED
|
@@ -3,10 +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.
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"tag": "next"
|
|
9
|
-
},
|
|
6
|
+
"version": "5.0.1",
|
|
10
7
|
"license": "MIT",
|
|
11
8
|
"bugs": "https://github.com/iconify/tools/issues",
|
|
12
9
|
"homepage": "https://github.com/iconify/tools",
|
|
@@ -21,27 +18,27 @@
|
|
|
21
18
|
"@iconify/types": "^2.0.0",
|
|
22
19
|
"@iconify/utils": "^3.1.0",
|
|
23
20
|
"fflate": "^0.8.2",
|
|
24
|
-
"modern-tar": "^0.7.
|
|
21
|
+
"modern-tar": "^0.7.3",
|
|
25
22
|
"pathe": "^2.0.3",
|
|
26
23
|
"svgo": "^4.0.0"
|
|
27
24
|
},
|
|
28
25
|
"devDependencies": {
|
|
29
|
-
"@eslint/eslintrc": "^3.3.
|
|
30
|
-
"@eslint/js": "^9.39.
|
|
26
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
27
|
+
"@eslint/js": "^9.39.2",
|
|
31
28
|
"@types/jest": "^30.0.0",
|
|
32
|
-
"@types/node": "^24.10.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
34
|
-
"@typescript-eslint/parser": "^8.
|
|
29
|
+
"@types/node": "^24.10.4",
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "^8.50.0",
|
|
31
|
+
"@typescript-eslint/parser": "^8.50.0",
|
|
35
32
|
"cross-env": "^10.1.0",
|
|
36
|
-
"eslint": "^9.39.
|
|
33
|
+
"eslint": "^9.39.2",
|
|
37
34
|
"eslint-config-prettier": "^10.1.8",
|
|
38
35
|
"eslint-plugin-prettier": "^5.5.4",
|
|
39
36
|
"globals": "^16.5.0",
|
|
40
|
-
"prettier": "^3.
|
|
37
|
+
"prettier": "^3.7.4",
|
|
41
38
|
"rimraf": "^6.1.2",
|
|
42
|
-
"tsdown": "^0.
|
|
39
|
+
"tsdown": "^0.18.0",
|
|
43
40
|
"typescript": "^5.9.3",
|
|
44
|
-
"vitest": "^4.0.
|
|
41
|
+
"vitest": "^4.0.16"
|
|
45
42
|
},
|
|
46
43
|
"exports": {
|
|
47
44
|
"./*": "./*",
|