code: function emptyBucket(aws, bucketName, keyPrefix) {
    return listObjectsInBucket(aws, bucketName).then(resp => {
      const contents = resp.Contents;
      let testPrefix = false,
        prefixRegexp;
      if (!contents[0]) {
        return Promise.resolve();
      } else {
  
        if (keyPrefix) {
          testPrefix = true;
          prefixRegexp = new RegExp('^' + keyPrefix);
        }
        const objects = contents.map(function(content) {
          return {Key: content.Key};
        }).filter(content => !testPrefix || prefixRegexp.test(content.Key));
  
        const params = {
          Bucket: bucketName,
          Delete: { Objects: objects }
        };
  
        return aws.request('S3', 'deleteObjects', params);
      }
    });
  }
docs: Deletes all objects in an S3 bucket
  @param {Object} aws - AWS class
  @param {string} bucketName - Name of bucket to be deleted