UNPKG

673 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.KafkaRequestDeserializer = void 0;
4const incoming_request_deserializer_1 = require("./incoming-request.deserializer");
5/**
6 * @publicApi
7 */
8class KafkaRequestDeserializer extends incoming_request_deserializer_1.IncomingRequestDeserializer {
9 mapToSchema(data, options) {
10 if (!options) {
11 return {
12 pattern: undefined,
13 data: undefined,
14 };
15 }
16 return {
17 pattern: options.channel,
18 data: data?.value ?? data,
19 };
20 }
21}
22exports.KafkaRequestDeserializer = KafkaRequestDeserializer;