UNPKG

715 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.RmqRecordSerializer = void 0;
4const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
5const record_builders_1 = require("../record-builders");
6class RmqRecordSerializer {
7 serialize(packet) {
8 if (packet?.data &&
9 (0, shared_utils_1.isObject)(packet.data) &&
10 packet.data instanceof record_builders_1.RmqRecord) {
11 const record = packet.data;
12 return {
13 ...packet,
14 data: record.data,
15 options: record.options,
16 };
17 }
18 return packet;
19 }
20}
21exports.RmqRecordSerializer = RmqRecordSerializer;