async function shpToGeoJSON(zip) {
const archive = await JSZip.loadAsync(zip);
const files = archive.file(/\.shp$/);
const results = {};
for (const file of files) {
const name = file.name.replace('.shp', '');
const shp = await file.async('arraybuffer');
const dbfFile = archive.file(`${name}.dbf`);
const dbf = dbfFile ? await dbfFile.async('arraybuffer') : undefined;
const geojson = await shapefile.read(shp, dbf);
results[name] = rewind(geojson, true);
}
return results;
}