mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 14:37:41 +01:00
* Ignore linting for examples in docs * Formatting JSX single attribute per line * Separte `format` and `lint:format` in package.json * Bump prettier version * Run format
16 lines
390 B
TypeScript
16 lines
390 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;
|