function deleteOldSnapshotZip(object) {
  const bucketId = object.bucket;
  const filePath = object.name;
  const contentType = object.contentType;

  const bucket = storage.bucket(bucketId);

  const snapshotFolderMatch = filePath.match(snapshotRegex);

  if (!snapshotFolderMatch ||	contentType !== 'application/zip') {
    return;
  }

  bucket.getFiles({
    prefix: snapshotFolderMatch[0],
    delimiter: '/',
    autoPaginate: false
  }).then(function(data) {
    const files = data[0];

    const oldZipFiles = files.filter(file => {
      return file.metadata.name !== filePath && file.metadata.contentType === 'application/zip';
    });

    console.info(`found ${oldZipFiles.length} old zip files to delete`);

    oldZipFiles.forEach(function(file) {
      file.delete();
    });

  });
}
The build folder contains a zip file that is unique per build.
When a new zip file is uploaded into snapshot or snapshot-stable,
delete the previous zip file.