Browse Source

fix makeSocket sesame param

master
peter 4 years ago
parent
commit
1986dca8b2
2 changed files with 4 additions and 4 deletions
  1. 1
    1
      package.json
  2. 3
    3
      src/Frontend.ts

+ 1
- 1
package.json View File

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "rpclibrary",
3
-  "version": "1.4.1",
3
+  "version": "1.4.2",
4 4
   "description": "rpclibrary is a websocket on steroids!",
5 5
   "main": "./js/Index.js",
6 6
   "repository": {

+ 3
- 3
src/Frontend.ts View File

@@ -17,8 +17,8 @@ function stripAfterEquals(str:string):string{
17 17
  * A websocket-on-steroids with built-in RPC capabilities
18 18
  */
19 19
 export class RPCSocket implements I.Socket{
20
-    static async makeSocket<T extends T.RPCInterface= T.RPCInterface>(port:number, server: string, sesame?:string, conf?:T.SocketConf): Promise<RPCSocket & T.RPCInterface<T>> {
21
-        const socket = <RPCSocket & T> new RPCSocket(port, server, conf)
20
+    static async makeSocket<T extends T.RPCInterface = T.RPCInterface>(port:number, server: string, sesame?:string, conf?:T.SocketConf): Promise<RPCSocket & T> {
21
+        const socket = new RPCSocket(port, server, conf)
22 22
         return await socket.connect<T>(sesame)
23 23
     }
24 24
 
@@ -95,7 +95,7 @@ export class RPCSocket implements I.Socket{
95 95
     /**
96 96
      * Connects to the server and attaches available RPCs to this object
97 97
      */
98
-    public async connect<T extends T.RPCInterface= T.RPCInterface>( sesame?: string ) : Promise<RPCSocket & T.RPCInterface<T>>{
98
+    public async connect<T extends T.RPCInterface= T.RPCInterface>( sesame?: string ) : Promise<RPCSocket & T>{
99 99
         this.socket = await bsock.connect(this.port, this.server, this.conf.tls?this.conf.tls:false)
100 100
 
101 101
         const info:T.ExtendedRpcInfo[] = await this.info()

Loading…
Cancel
Save