Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_readFrame(message: MessageEvent): Frame {
const buffer = toBuffer(message.data);
const frame = this._options.lengthPrefixedFrames
? deserializeFrameWithLength(buffer, this._encoders)
: deserializeFrame(buffer, this._encoders);
if (__DEV__) {
if (this._options.debug) {
console.log(printFrame(frame));
}
}
return frame;
}