UNPKG

807 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 var _a;
8 if (!args) {
9 return null;
10 }
11 switch (type) {
12 case rpc_paramtype_enum_1.RpcParamtype.PAYLOAD:
13 return data ? (_a = args[0]) === null || _a === void 0 ? void 0 : _a[data] : args[0];
14 case rpc_paramtype_enum_1.RpcParamtype.CONTEXT:
15 return args[1];
16 case rpc_paramtype_enum_1.RpcParamtype.GRPC_CALL:
17 return args[2];
18 default:
19 return null;
20 }
21 }
22}
23exports.RpcParamsFactory = RpcParamsFactory;