kafka-ts
Version:
**KafkaTS** is a Apache Kafka client library for Node.js. It provides both a low-level API for communicating directly with the Apache Kafka cluster and high-level APIs for publishing and subscribing to Kafka topics.
13 lines (12 loc) • 386 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.groupPartitionsByTopic = void 0;
const groupPartitionsByTopic = (items) => {
const result = {};
items.forEach((item) => {
result[item.topic] ??= [];
result[item.topic].push(item.partition);
});
return result;
};
exports.groupPartitionsByTopic = groupPartitionsByTopic;