async function downloadZIP(filesOrBlob, filename = 'output.zip') {
  /** @type {Blob} */
  let zipBlob;
  // check if it's a Blob.., instanceof is too strict e.g. Blob polyfills
  if (filesOrBlob.constructor.name === 'Blob') {
    zipBlob = /** @type {Blob} */ (filesOrBlob);
  } else {
    const zipWriter = new ZipWriter(new BlobWriter('application/zip'));

    await Promise.all(
      Object.entries(filesOrBlob).map(([key, value]) => zipWriter.add(key, new TextReader(value))),
    );

    // Close zip and make into URL
    zipBlob = await zipWriter.close();
  }
  downloadBlob(zipBlob, filename);
}
@param {Record<string, string> | Blob} filesOrBlob
@param {string} filename