lib/utils.js
function createTopicPartitionList (topicPartitions) {
  var tpList = [];
  for (var topic in topicPartitions) {
    if (!topicPartitions.hasOwnProperty(topic)) {
      continue;
    }
    topicPartitions[topic].forEach(function (partition) {
      tpList.push({
        topic: topic,
        partition: partition
      });
    });
  }
  return tpList;
}
function createTopicPartitionList (topicPartitions) {
  var tpList = [];
  for (var topic in topicPartitions) {
    if (!topicPartitions.hasOwnProperty(topic)) {
      continue;
    }
    topicPartitions[topic].forEach(function (partition) {
      tpList.push({
        topic: topic,
        partition: partition
      });
    });
  }
  return tpList;
}
/*
Converts:
{
test: [0, 1],
bob: [0]
}

Into a topic partition payload:
[
{topic: 'test', partition: 0},
{topic: 'test', partition: 1},
{topic: 'Bob', partition: 0}
]