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.
18 lines (17 loc) • 426 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.findCodec = void 0;
const gzip_1 = require("./gzip");
const none_1 = require("./none");
const codecs = {
0: none_1.NONE,
1: gzip_1.GZIP,
};
const findCodec = (type) => {
const codec = codecs[type];
if (!codec) {
throw new Error(`Unsupported codec: ${type}`);
}
return codec;
};
exports.findCodec = findCodec;