1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.RmqRecordSerializer = void 0;
|
4 | const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
5 | const record_builders_1 = require("../record-builders");
|
6 | class 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 | }
|
21 | exports.RmqRecordSerializer = RmqRecordSerializer;
|