docs: function buildAssignmentsAsync(kafkaConsumer, assignments, atTimestamp, defaultOffset = -1) {
      // This will be merged into the partition assignment that don't already have either
      // timestamp or offset set, to either have the assignment start from atTimestamp if given,
      // else defaultOffset.
      const defaultResumePosition = atTimestamp ? {timestamp: atTimestamp} : {offset: defaultOffset};
  
      // Convert any string topic assignment entries to assignment objects
      // including all partitions.
      assignments = _.flatten(
          assignments.map((a) => {
              // If this assignment was given as a string topic, convert it to a list
              // of all topic partition assignments for the topic starting from
              // atTimestamp|defaultOffset.
              if (_.isString(a)) {
                  a = topicsToPartitionAssignment(
                      kafkaConsumer._metadata.topics, a, atTimestamp, defaultOffset
                  );
              }
              // Else this is an assignment object.
              // Make sure it has either an offset or a timestamp.
              // If not, merge in defaultResumePosition to set one.
              else if (!('offset' in a) && !('timestamp') in a) {
                  a = Object.assign(a, defaultResumePosition);
              }
              return a;
          })
      );
  
      // We are now sure we have an array of assignment objects.
      // For any that don't have an offset, but have a timestamp set, we need
      // to query offsetsForTimes to convert the timestamps to offsets.
      return assignmentsForTimesAsync(kafkaConsumer, assignments);
  }