mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-08-29 11:38:25 +02:00
* chore(lab): Adjust build scripts * add check workflow * Potential fix for pull request finding 'CodeQL / Workflow does not contain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * update gitignore --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
15 lines
579 B
TypeScript
15 lines
579 B
TypeScript
import { writeFile } from '@lucide/helpers';
|
|
import { type SVGFile } from './readSvgs.mts';
|
|
|
|
export default async function generateIconNodes(parsedSvgs: SVGFile[], packageDir: string) {
|
|
const iconNodes = parsedSvgs.reduce((acc, { name, parsedSvg }) => {
|
|
acc[name] = parsedSvg.children.map(({ name, attributes }) => [name, attributes]);
|
|
|
|
return acc;
|
|
}, {} as Record<string, [string, Record<string, unknown> | undefined][]>);
|
|
|
|
const iconNodesStringified = JSON.stringify(iconNodes, null, 2);
|
|
|
|
await writeFile(iconNodesStringified, 'icon-nodes.json', packageDir);
|
|
}
|