fix(core): update
This commit is contained in:
parent
5aa8048ce8
commit
952835e46a
3632
package-lock.json
generated
3632
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@ -12,19 +12,19 @@
|
|||||||
"build": "(tsbuild --web)"
|
"build": "(tsbuild --web)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.25",
|
"@gitzone/tsbuild": "^2.1.28",
|
||||||
"@gitzone/tsbundle": "^1.0.80",
|
"@gitzone/tsbundle": "^1.0.88",
|
||||||
"@gitzone/tstest": "^1.0.54",
|
"@gitzone/tstest": "^1.0.59",
|
||||||
"@pushrocks/tapbundle": "^3.2.14",
|
"@pushrocks/tapbundle": "^3.2.14",
|
||||||
"@types/node": "^16.3.3",
|
"@types/node": "^16.11.3",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apiglobal/typedrequest": "^1.0.56",
|
"@apiglobal/typedrequest": "^1.0.58",
|
||||||
"@apiglobal/typedrequest-interfaces": "^1.0.15",
|
"@apiglobal/typedrequest-interfaces": "^1.0.15",
|
||||||
"@pushrocks/isohash": "^1.0.2",
|
"@pushrocks/isohash": "^1.0.2",
|
||||||
"@pushrocks/smartexpress": "^3.0.102",
|
"@pushrocks/smartexpress": "^3.0.107",
|
||||||
"@pushrocks/smartsocket": "^1.2.8",
|
"@pushrocks/smartsocket": "^1.2.8",
|
||||||
"@pushrocks/smartstring": "^3.0.24"
|
"@pushrocks/smartstring": "^3.0.24"
|
||||||
},
|
},
|
||||||
|
@ -37,6 +37,8 @@ tap.test('should create Server and Client', async (tools) => {
|
|||||||
await tools.delayFor(1000);
|
await tools.delayFor(1000);
|
||||||
await testTypedSocketServer.stop();
|
await testTypedSocketServer.stop();
|
||||||
testTypedSocketServer = await typedsocket.TypedSocket.createServer(testTypedRouter);
|
testTypedSocketServer = await typedsocket.TypedSocket.createServer(testTypedRouter);
|
||||||
|
|
||||||
|
// lets see if auto reconnect works
|
||||||
await tools.delayFor(60000);
|
await tools.delayFor(60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -157,6 +157,11 @@ export class TypedSocket {
|
|||||||
return typedrequest;
|
return typedrequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns all matching target connection
|
||||||
|
* @param asyncFindFuncArg
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
public async findAllTargetConnections(
|
public async findAllTargetConnections(
|
||||||
asyncFindFuncArg: (connectionArg: plugins.smartsocket.SocketConnection) => Promise<boolean>
|
asyncFindFuncArg: (connectionArg: plugins.smartsocket.SocketConnection) => Promise<boolean>
|
||||||
) {
|
) {
|
||||||
@ -173,10 +178,15 @@ export class TypedSocket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns a single target connection by returning the first one of all matching ones
|
||||||
|
* @param asyncFindFuncArg
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
public async findTargetConnection(
|
public async findTargetConnection(
|
||||||
asyncFindFuncArg: (connectionArg: plugins.smartsocket.SocketConnection) => Promise<boolean>
|
asyncFindFuncArg: (connectionArg: plugins.smartsocket.SocketConnection) => Promise<boolean>
|
||||||
) {
|
) {
|
||||||
const allMatching = this.findAllTargetConnections(asyncFindFuncArg);
|
const allMatching = await this.findAllTargetConnections(asyncFindFuncArg);
|
||||||
return allMatching[0];
|
return allMatching[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,16 +194,16 @@ export class TypedSocket {
|
|||||||
return this.findAllTargetConnections(async socketConnectionArg => {
|
return this.findAllTargetConnections(async socketConnectionArg => {
|
||||||
let result: boolean;
|
let result: boolean;
|
||||||
if (!payloadArg) {
|
if (!payloadArg) {
|
||||||
result = !!socketConnectionArg.getTagById('keyArg')
|
result = !!socketConnectionArg.getTagById(keyArg);
|
||||||
} else {
|
} else {
|
||||||
result = !!socketConnectionArg.getTagById('keyArg') === payloadArg;
|
result = !!socketConnectionArg.getTagById(keyArg) === payloadArg;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public async findTargetConnectionByTag(keyArg: string, payloadArg?: any) {
|
public async findTargetConnectionByTag(keyArg: string, payloadArg?: any) {
|
||||||
const allResults = this.findAllTargetConnectionsByTag(keyArg, payloadArg)
|
const allResults = await this.findAllTargetConnectionsByTag(keyArg, payloadArg)
|
||||||
return allResults[0];
|
return allResults[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user