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

Function deconstructPacket

packages/socket.io-parser/lib/binary.ts:11–18  ·  view source on GitHub ↗
(packet)

Source from the content-addressed store, hash-verified

9 */
10
11export function deconstructPacket(packet) {
12 const buffers = [];
13 const packetData = packet.data;
14 const pack = packet;
15 pack.data = _deconstructPacket(packetData, buffers);
16 pack.attachments = buffers.length; // number of binary 'attachments'
17 return { packet: pack, buffers: buffers };
18}
19
20function _deconstructPacket(data, buffers) {
21 if (!data) return data;

Callers

nothing calls this directly

Calls 1

_deconstructPacketFunction · 0.70

Tested by

no test coverage detected