1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.NatsResponseJSONDeserializer = void 0;
|
4 | const load_package_util_1 = require("@nestjs/common/utils/load-package.util");
|
5 | const incoming_response_deserializer_1 = require("./incoming-response.deserializer");
|
6 | const nats_request_json_deserializer_1 = require("./nats-request-json.deserializer");
|
7 | let natsPackage = {};
|
8 |
|
9 |
|
10 |
|
11 | class NatsResponseJSONDeserializer extends incoming_response_deserializer_1.IncomingResponseDeserializer {
|
12 | constructor() {
|
13 | super();
|
14 | natsPackage = (0, load_package_util_1.loadPackage)('nats', nats_request_json_deserializer_1.NatsRequestJSONDeserializer.name, () => require('nats'));
|
15 | this.jsonCodec = natsPackage.JSONCodec();
|
16 | }
|
17 | deserialize(value, options) {
|
18 | const decodedRequest = this.jsonCodec.decode(value);
|
19 | return super.deserialize(decodedRequest, options);
|
20 | }
|
21 | }
|
22 | exports.NatsResponseJSONDeserializer = NatsResponseJSONDeserializer;
|