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

Function decodePayload

packages/engine.io-parser/lib/index.ts:33–47  ·  packages/engine.io-parser/lib/index.ts::decodePayload
(
  encodedPayload: string,
  binaryType?: BinaryType,
)

Source from the content-addressed store, hash-verified

31};
32
33const decodePayload = (
34 encodedPayload: string,
35 binaryType?: BinaryType,
36): Packet[] => {
37 const encodedPackets = encodedPayload.split(SEPARATOR);
38 const packets = [];
39 for (let i = 0; i < encodedPackets.length; i++) {
40 const decodedPacket = decodePacket(encodedPackets[i], binaryType);
41 packets.push(decodedPacket);
42 if (decodedPacket.type === class="st">"error") {
43 break;
44 }
45 }
46 return packets;
47};
48
49export function createPacketEncoderStream(): any {
50 return new TransformStream({

Callers 4

onDataFunction · 0.90
index.tsFile · 0.50
browser.tsFile · 0.50
node.tsFile · 0.50

Calls 1

decodePacketFunction · 0.90

Tested by

no test coverage detected