lib/client/signalflow/websocket_message_parser.js
function (msg, knownComputations) {
    if (msg.data && msg.data.byteLength) {
      // The presence of byteLength indicates data is an ArrayBuffer from a WebSocket data frame.
      return parseBinaryMessage(msg.data, knownComputations);
    } else if (msg.type) {
      // Otherwise it's JSON in a WebSocket text frame.
      return JSON.parse(msg.data);
    } else {
      console.warn('Unrecognized websocket message.');
      return null;
    }
  }
function (msg, knownComputations) {
    if (msg.data && msg.data.byteLength) {
      // The presence of byteLength indicates data is an ArrayBuffer from a WebSocket data frame.
      return parseBinaryMessage(msg.data, knownComputations);
    } else if (msg.type) {
      // Otherwise it's JSON in a WebSocket text frame.
      return JSON.parse(msg.data);
    } else {
      console.warn('Unrecognized websocket message.');
      return null;
    }
  }
function ( msg , knownComputations ) { if ( msg . data && msg . data . byteLength ) { // The presence of byteLength indicates data is an ArrayBuffer from a WebSocket data frame. return parseBinaryMessage ( msg . data , knownComputations ) ; } else if ( msg . type ) { // Otherwise it's JSON in a WebSocket text frame. return JSON . parse ( msg . data ) ; } else { console . warn ( 'Unrecognized websocket message.' ) ; return null ; } }
Parse the given received WebSocket message into its canonical Javascript representation.
Parse the given received WebSocket message into its canonical Javascript representation .