UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 674 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ async function e(e){const r=[];for(const n of e)n.name.toLowerCase().endsWith(".zip")?r.push(t(n)):r.push(Promise.resolve(n));return(await Promise.all(r)).flat()}async function t(e){const{BlobReader:t,ZipReader:r,BlobWriter:n}=await import("./zipjs-wrapper.js"),a=[],i=new r(new t(e));return(await i.getEntries()).forEach((e=>{if(e.directory||/^__MACOS/i.test(e.filename))return;const t=new n,r=e.getData?.(t).then((t=>new File([t],e.filename)));r&&a.push(r)})),Promise.all(a)}export{t as extractZipFile,e as extractZipFiles};