UNPKG

746 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.RpcParamsFactory = void 0;
4const rpc_paramtype_enum_1 = require("../enums/rpc-paramtype.enum");
5class 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}
22exports.RpcParamsFactory = RpcParamsFactory;