temp/www/build/bundle.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) {
            if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {
                if (hasBinary(obj)) {
                    obj.type =
                        obj.type === PacketType.EVENT
                            ? PacketType.BINARY_EVENT
                            : PacketType.BINARY_ACK;
                    return this.encodeAsBinary(obj);
                }
            }
            return [this.encodeAsString(obj)];
        }
encode ( obj ) { if ( obj . type === PacketType . EVENT || obj . type === PacketType . ACK ) { if ( 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 .