1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.RpcParamsFactory = void 0;
|
4 | const rpc_paramtype_enum_1 = require("../enums/rpc-paramtype.enum");
|
5 | class RpcParamsFactory {
|
6 | exchangeKeyForValue(type, data, args) {
|
7 | if (!args) {
|
8 | return null;
|
9 | }
|
10 | switch (type) {
|
11 | case rpc_paramtype_enum_1.RpcParamtype.PAYLOAD:
|
12 | return data ? args[0]?.[data] : args[0];
|
13 | case rpc_paramtype_enum_1.RpcParamtype.CONTEXT:
|
14 | return args[1];
|
15 | case rpc_paramtype_enum_1.RpcParamtype.GRPC_CALL:
|
16 | return args[2];
|
17 | default:
|
18 | return null;
|
19 | }
|
20 | }
|
21 | }
|
22 | exports.RpcParamsFactory = RpcParamsFactory;
|