mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 22:27:43 +01:00
* Adjust typescript types * adjust types * fix types in all helper files * Fix types * Migrate js files to ts files * Refactor to TS files * Rename extentions * Adjust imports * Fix builds * Update lockfile * Fix last typescript migration * Fix entry path @lucide/outline-svg * Fix types * add checkout step * format files * Format files
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);
|
|
}
|