async function ZIP(prefix, { depth=2, alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' }) {
const canvas = CANVAS('A');
const z = zip();
const root = z.folder('icons').folder(prefix);
await RECURSE(prefix, depth);
const blob = await z.generateAsync({ type: 'blob' });
return DOM.download(blob, `icons.zip`);
async function RECURSE(prefix, depth) {
for (let i=0, n=alphabet.length; i<n; ++i) {
const text = prefix + alphabet.charAt(i);
await FILE(text);
if (depth > 0) {
RECURSE(text, depth - 1);
}
}
}
async function FILE(text) {
const blob = await ICON(CANVAS(text, { canvas }));
root.file(`${text}.ico`, blob);
}
}