Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public handshake() {
/**
* Cache handshake to avoid encoding it for each client joining
*/
if (!this.handshakeCache) {
this.handshakeCache = (this.state && Reflection.encode(this.state));
}
return this.handshakeCache;
}