dist/client/lance-gg.js
/**
       * Encode a packet as a single string if non-binary, or as a
       * buffer sequence, depending on packet type.
       *
       * @param {Object} obj - packet object
       */
Encode a packet as a single string if non-binary, or as a
buffer sequence, depending on packet type.

@param {Object} obj - packet object
Encode a packet as a single string if non - binary or as a buffer sequence depending on packet type . @param { Object } obj - packet object
encode(obj) {
          debug("encoding packet %j", obj);
          if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {
              if (isBinary_1.hasBinary(obj)) {
                  obj.type =
                      obj.type === PacketType.EVENT
                          ? PacketType.BINARY_EVENT
                          : PacketType.BINARY_ACK;
                  return this.encodeAsBinary(obj);
              }
          }
          return [this.encodeAsString(obj)];
      }
encode ( obj ) { debug ( "encoding packet %j" , obj ) ; if ( obj . type === PacketType . EVENT || obj . type === PacketType . ACK ) { if ( isBinary_1 . hasBinary ( obj ) ) { obj . type = obj . type === PacketType . EVENT ? PacketType . BINARY_EVENT : PacketType . BINARY_ACK ; return this . encodeAsBinary ( obj ) ; } } return [ this . encodeAsString ( obj ) ] ; }
Encode a packet as a single string if non-binary, or as a
 buffer sequence, depending on packet type.
Encode a packet as a single string if non - binary or as a buffer sequence depending on packet type .