peter 5年前
コミット
3dadc48b32
2個のファイルの変更17行の追加10行の削除
  1. 11
    9
      docs/modules/_utils_.md
  2. 6
    1
      src/Utils.ts

+ 11
- 9
docs/modules/_utils_.md ファイルの表示

@@ -18,7 +18,7 @@
18 18
 
19 19
 ▸ **extractArgs**(`f`: Function): *T.Arg[]*
20 20
 
21
-Defined in Utils.ts:91
21
+Defined in Utils.ts:96
22 22
 
23 23
 **Parameters:**
24 24
 
@@ -34,7 +34,7 @@ ___
34 34
 
35 35
 ▸ **hookGenerator**(`rpc`: T.HookRPC‹any›): *function*
36 36
 
37
-Defined in Utils.ts:70
37
+Defined in Utils.ts:75
38 38
 
39 39
 **Parameters:**
40 40
 
@@ -58,7 +58,7 @@ ___
58 58
 
59 59
 ▸ **makeSubResponse**(`uuid?`: undefined | string): *[SubscriptionResponse](_types_.md#subscriptionresponse)*
60 60
 
61
-Defined in Utils.ts:96
61
+Defined in Utils.ts:101
62 62
 
63 63
 **Parameters:**
64 64
 
@@ -74,7 +74,7 @@ ___
74 74
 
75 75
 ▸ **rpcHooker**<**SubResT**>(`socket`: [Socket](../interfaces/_interfaces_.socket.md), `exporter`: [Exporter](../interfaces/_interfaces_.exporter.md)‹SubResT›, `makeUnique`: boolean): *T.ExtendedRpcInfo[]*
76 76
 
77
-Defined in Utils.ts:48
77
+Defined in Utils.ts:53
78 78
 
79 79
 **Type parameters:**
80 80
 
@@ -96,7 +96,9 @@ ___
96 96
 
97 97
 ▸ **rpcToRpcinfo**<**SubResT**>(`rpc`: T.RPC‹SubResT›, `owner`: T.Owner): *T.RpcInfo*
98 98
 
99
-Defined in Utils.ts:8
99
+Defined in Utils.ts:13
100
+
101
+Translate an RPC to RPCInfo for serialization.
100 102
 
101 103
 **Type parameters:**
102 104
 
@@ -104,9 +106,9 @@ Defined in Utils.ts:8
104 106
 
105 107
 **Parameters:**
106 108
 
107
-Name | Type |
108
------- | ------ |
109
-`rpc` | T.RPC‹SubResT› |
110
-`owner` | T.Owner |
109
+Name | Type | Description |
110
+------ | ------ | ------ |
111
+`rpc` | T.RPC‹SubResT› | The RPC to transform |
112
+`owner` | T.Owner | The owning RPC group's name |
111 113
 
112 114
 **Returns:** *T.RpcInfo*

+ 6
- 1
src/Utils.ts ファイルの表示

@@ -4,7 +4,12 @@ import * as T from "./Types";
4 4
 import * as I from "./Interfaces";
5 5
 import { SubscriptionResponse } from "./Types";
6 6
 
7
-
7
+/**
8
+ * Translate an RPC to RPCInfo for serialization.
9
+ * @param rpc The RPC to transform
10
+ * @param owner The owning RPC group's name
11
+ * @throws Error on RPC without name property
12
+ */
8 13
 export const rpcToRpcinfo = <SubResT = {}>(rpc : T.RPC<SubResT>, owner: T.Owner):T.RpcInfo => {
9 14
     switch (typeof rpc){
10 15
         case  "object":

読み込み中…
キャンセル
保存