mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-19 05:09:20 +01:00
18 lines
394 B
TypeScript
18 lines
394 B
TypeScript
|
|
export type IconContent = [icon: string, src:string];
|
||
|
|
|
||
|
|
async function generateZip(icons: IconContent[]) {
|
||
|
|
const JSZip = (await import('jszip')).default
|
||
|
|
|
||
|
|
const zip = new JSZip();
|
||
|
|
|
||
|
|
const addingZipPromises = icons.map(([name, src]) =>
|
||
|
|
zip.file(`${name}.svg`, src),
|
||
|
|
);
|
||
|
|
|
||
|
|
await Promise.all(addingZipPromises)
|
||
|
|
|
||
|
|
return zip.generateAsync({ type: 'blob' });
|
||
|
|
}
|
||
|
|
|
||
|
|
export default generateZip
|