diff --git a/scripts/generate-file-tree-sprite.ts b/scripts/generate-file-tree-sprite.ts index 67adabc0e5..d18acee734 100644 --- a/scripts/generate-file-tree-sprite.ts +++ b/scripts/generate-file-tree-sprite.ts @@ -32,9 +32,14 @@ async function loadCollections() { function groupByCollection(iconNames: string[]) { const grouped: { [key: string]: string[] } = {} + const seen = new Set() + for (const name of iconNames) { const [, group, iconName] = name.match(COLLECTION_REGEXP) || [] if (group && iconName) { + const key = `${group}-${iconName}` + if (seen.has(key)) continue + seen.add(key) grouped[group] ||= [] grouped[group].push(iconName) }