code: function validateAssignments(assignments) {
      // We will only throw this Error if assignments doesn't validate.
      // We pre-create it here just to DRY.
      let assignmentError = new Error(
          'Must provide either an array topic names, or ' +
          ' an array of objects with topic, partition and offset|timestamp.'
      );
      assignmentError.assignments = assignments;
  
      if (!_.isArray(assignments) || _.isEmpty(assignments)) {
          throw assignmentError;
      }
  
      // Every assignement must either be...
      if (!assignments.every((a) => (
              // a string topic name
              _.isString(a) || (
              // or a an assignment object
                  _.isPlainObject(a)          &&
                  _.isString(a.topic)         &&
                  _.isInteger(a.partition)    &&
                  (_.isInteger(a.offset) || _.isInteger(a.timestamp))
              )
      ))) {
          throw assignmentError;
      }
  
      return true;
  }
docs: Checks assignments and makes sure it is either an Array of String
  topic names, or it is an Array of plain objects containing
  topic, partition, and offset|timestamp properties.  If neither of these
  conditions is met, this will throw an Error.  Otherwise returns true.
  This validates that assignments are suitable for use in KafkaSSE, NOT
  for use by KafkaConsumer.assign().  First pass these assignments through
  buildAssignmentsAsync().
  
  @param  {Array} assignments
  @throws {Error}
  @return {Boolean}