fix makeSocket sesame param
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rpclibrary",
|
"name": "rpclibrary",
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"description": "rpclibrary is a websocket on steroids!",
|
"description": "rpclibrary is a websocket on steroids!",
|
||||||
"main": "./js/Index.js",
|
"main": "./js/Index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
+3
-3
@@ -17,8 +17,8 @@ function stripAfterEquals(str:string):string{
|
|||||||
* A websocket-on-steroids with built-in RPC capabilities
|
* A websocket-on-steroids with built-in RPC capabilities
|
||||||
*/
|
*/
|
||||||
export class RPCSocket implements I.Socket{
|
export class RPCSocket implements I.Socket{
|
||||||
static async makeSocket<T extends T.RPCInterface= T.RPCInterface>(port:number, server: string, sesame?:string, conf?:T.SocketConf): Promise<RPCSocket & T.RPCInterface<T>> {
|
static async makeSocket<T extends T.RPCInterface = T.RPCInterface>(port:number, server: string, sesame?:string, conf?:T.SocketConf): Promise<RPCSocket & T> {
|
||||||
const socket = <RPCSocket & T> new RPCSocket(port, server, conf)
|
const socket = new RPCSocket(port, server, conf)
|
||||||
return await socket.connect<T>(sesame)
|
return await socket.connect<T>(sesame)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ export class RPCSocket implements I.Socket{
|
|||||||
/**
|
/**
|
||||||
* Connects to the server and attaches available RPCs to this object
|
* Connects to the server and attaches available RPCs to this object
|
||||||
*/
|
*/
|
||||||
public async connect<T extends T.RPCInterface= T.RPCInterface>( sesame?: string ) : Promise<RPCSocket & T.RPCInterface<T>>{
|
public async connect<T extends T.RPCInterface= T.RPCInterface>( sesame?: string ) : Promise<RPCSocket & T>{
|
||||||
this.socket = await bsock.connect(this.port, this.server, this.conf.tls?this.conf.tls:false)
|
this.socket = await bsock.connect(this.port, this.server, this.conf.tls?this.conf.tls:false)
|
||||||
|
|
||||||
const info:T.ExtendedRpcInfo[] = await this.info()
|
const info:T.ExtendedRpcInfo[] = await this.info()
|
||||||
|
|||||||
Reference in New Issue
Block a user