2024-06-28 11:24:37 +02:00
|
|
|
import { writeFile } from '@lucide/helpers';
|
2021-11-21 20:27:15 +01:00
|
|
|
|
2025-02-10 14:13:52 +01:00
|
|
|
export default async function generateIconNodes(parsedSvgs, packageDir) {
|
2021-11-21 20:27:15 +01:00
|
|
|
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);
|
|
|
|
|
|
2025-02-10 14:13:52 +01:00
|
|
|
await writeFile(iconNodesStringified, 'icon-nodes.json', packageDir);
|
2021-11-21 20:27:15 +01:00
|
|
|
}
|