mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-19 01:09:23 +01:00
* cleanup scripts * Move helpers to package * Fixes scripts * Fix scripts * Formatting * Fix helpers import paths * Remove lucide-figma * Rename helpers package * Fix build * formatting * Adjust main build-icons file * Add export casing * Adds `exportModuleNameCasing` fro lab project * format files * Bump package version @lucide/build-icons * Revert changes in icons * Revert changes in PR yml * Fix lint issues * Fix site build * fix lint errors * Attempt fix linting * Fix lint errors
14 lines
434 B
JavaScript
14 lines
434 B
JavaScript
import { writeFile } from '@lucide/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);
|
|
}
|