function readZip(reader, name = '<unknown>') {
  const locator = readEndOfCentralDirectoryRecord(reader);
  const centralRecords = readCentralDirectory(reader, locator);
  const localRecords = readLocalFiles(reader, centralRecords);
  const files = new Map();

  for (let i = 0; i < centralRecords.length; i += 1) {
    const centralRecord = centralRecords[i];
    const localRecord = localRecords[i];

    checkRecords(centralRecord, localRecord, name);

    if (isEncrypted(centralRecord.bitFlag)) {
      throw Error('Encrypted zip are not supported');
    }

    const isDir = (centralRecord.externalFileAttributes & 0x0010) !== 0;
    if (!isDir) {
      const compressedFile = recordToFile(centralRecord, localRecord);
      const decompressedFile = decompressFile(compressedFile);
      const decodedFile = decodeFile(decompressedFile);
      files.set(decodedFile.name, decodedFile);
    }
    // TODO handle explicit directory entries
  }
  return files;
}
@param {BufferReader} reader
@param {string} name