This commit is contained in:
2019-09-22 10:25:15 +02:00
parent d0204faf47
commit 3dadc48b32
2 changed files with 17 additions and 10 deletions
+6 -1
View File
@@ -4,7 +4,12 @@ import * as T from "./Types";
import * as I from "./Interfaces";
import { SubscriptionResponse } from "./Types";
/**
* Translate an RPC to RPCInfo for serialization.
* @param rpc The RPC to transform
* @param owner The owning RPC group's name
* @throws Error on RPC without name property
*/
export const rpcToRpcinfo = <SubResT = {}>(rpc : T.RPC<SubResT>, owner: T.Owner):T.RpcInfo => {
switch (typeof rpc){
case "object":