mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-18 10:17:42 +01:00
14 lines
443 B
JavaScript
14 lines
443 B
JavaScript
|
|
import { writeFile } from '../../../scripts/helpers';
|
||
|
|
|
||
|
|
export default function generateIconNodes(parsedSvgs, packageDir) {
|
||
|
|
const iconNodes = parsedSvgs.reduce((acc, { name, parsedSvg }) => {
|
||
|
|
acc[name] = parsedSvg.children.map(({ name, attributes }) => [name, attributes]);
|
||
|
|
|
||
|
|
return acc;
|
||
|
|
}, {});
|
||
|
|
|
||
|
|
const iconNodesStringified = JSON.stringify(iconNodes, null, 2);
|
||
|
|
|
||
|
|
writeFile(iconNodesStringified, 'icon-nodes.json', packageDir);
|
||
|
|
}
|