Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function link(hostUri: AnyUri | null | undefined, nodeUri: AnyUri | null | undefined,
laneUri: AnyUri | null | undefined, format?: string | null): client.Downlink {
return client.downlink()
.hostUri(hostUri)
.nodeUri(nodeUri)
.laneUri(laneUri)
.keepSynced(true)
.onEvent((body: Value) => {
if (format === "json") {
console.log(JSON.stringify(body.toAny()));
} else {
console.log(Recon.toString(body));
}
})
.didUnlink((downlink: client.Downlink) => {
downlink.close();
});
}