mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-12 13:38:32 +00:00
16 lines
509 B
JavaScript
16 lines
509 B
JavaScript
import path from 'path';
|
|
import icons from '../icons.json';
|
|
import { writeFile } from './helpers';
|
|
|
|
const newCategories = {};
|
|
Object.keys(icons.icons).forEach(iconName => {
|
|
icons.icons[iconName].categories.forEach(categoryName => {
|
|
newCategories[categoryName] = newCategories[categoryName] || [];
|
|
newCategories[categoryName].push(iconName);
|
|
});
|
|
});
|
|
|
|
const categoriesContent = JSON.stringify(newCategories, null, 2);
|
|
|
|
writeFile(categoriesContent, 'categories.json', path.resolve(__dirname, '..'));
|