mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 18:27:41 +01:00
* Revert sync to async functions * Replace more sync fs functions * Format files * Fix build svelte package
14 lines
446 B
JavaScript
14 lines
446 B
JavaScript
import { writeFile } from '@lucide/helpers';
|
|
|
|
export default async 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);
|
|
|
|
await writeFile(iconNodesStringified, 'icon-nodes.json', packageDir);
|
|
}
|