Skip to content

Commit c72a79b

Browse files
committed
only-include-used-icons shouldn't be verbose
1 parent 5aac6df commit c72a79b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/bin/only-include-used-icons.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ async function main() {
213213
return { availableDsfrIconClassNames, availableRemixiconIconClassNames };
214214
})();
215215

216-
const usedIconClassNames: string[] = [];
216+
const setUsedIconClassNames = new Set<string>();
217217

218218
await Promise.all(
219219
candidateFilePaths.map(async candidateFilePath => {
@@ -229,16 +229,14 @@ async function main() {
229229
return;
230230
}
231231

232-
usedIconClassNames.push(className);
232+
setUsedIconClassNames.add(className);
233233
});
234234
})
235235
);
236236

237-
return { usedIconClassNames };
237+
return { "usedIconClassNames": Array.from(setUsedIconClassNames) };
238238
})();
239239

240-
console.log("Detected usage of the following icons: ", usedIconClassNames);
241-
242240
const usedIcons = usedIconClassNames.map(className => {
243241
const icon = icons.find(({ prefix, iconId }) => `${prefix}${iconId}` === className);
244242

0 commit comments

Comments
 (0)