Compare commits

...
1 Commits
Author SHA1 Message Date
Ken 3b9e755976 refactor(mcp): use getOrInsert for map 2026-09-02 12:19:01 +02:00
2 changed files with 6 additions and 10 deletions

No files matched your search

@@ -12,15 +12,11 @@ const categoriesMap = new Map<
const metadata = unParsedMetadata as unknown as Record<string, AkselIcon>;
for (const icon of Object.values(metadata)) {
let entry = categoriesMap.get(icon.category);
if (!entry) {
entry = {
category: icon.category,
subcategories: new Set(),
iconCount: 0,
};
categoriesMap.set(icon.category, entry);
}
const entry = categoriesMap.getOrInsert(icon.category, {
category: icon.category,
subcategories: new Set(),
iconCount: 0,
});
entry.subcategories.add(icon.sub_category);
entry.iconCount++;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2022",
"target": "esnext",
"module": "nodenext",
"moduleResolution": "nodenext",
"rootDir": "./src",