MCPcopy
hub / github.com/socketio/socket.io / encode

Function encode

examples/basic-websocket-client/src/index.js:222–230  ·  view source on GitHub ↗
(packet)

Source from the content-addressed store, hash-verified

220}
221
222function encode(packet) {
223 let output = "" + packet.type;
224
225 if (packet.data) {
226 output += JSON.stringify(packet.data);
227 }
228
229 return output;
230}
231
232function decode(data) {
233 let i = 1; // skip "4" prefix

Callers 1

#sendPacketMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected