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