Quellcode durchsuchen

fix makeSocket sesame param

master
peter vor 4 Jahren
Ursprung
Commit
1986dca8b2
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 1
    1
      package.json
  2. 3
    3
      src/Frontend.ts

+ 1
- 1
package.json Datei anzeigen

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

+ 3
- 3
src/Frontend.ts Datei anzeigen

17
  * A websocket-on-steroids with built-in RPC capabilities
17
  * A websocket-on-steroids with built-in RPC capabilities
18
  */
18
  */
19
 export class RPCSocket implements I.Socket{
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
         return await socket.connect<T>(sesame)
22
         return await socket.connect<T>(sesame)
23
     }
23
     }
24
 
24
 
95
     /**
95
     /**
96
      * Connects to the server and attaches available RPCs to this object
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
         this.socket = await bsock.connect(this.port, this.server, this.conf.tls?this.conf.tls:false)
99
         this.socket = await bsock.connect(this.port, this.server, this.conf.tls?this.conf.tls:false)
100
 
100
 
101
         const info:T.ExtendedRpcInfo[] = await this.info()
101
         const info:T.ExtendedRpcInfo[] = await this.info()

Laden…
Abbrechen
Speichern