(packet)
| 9 | */ |
| 10 | |
| 11 | export 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 | |
| 20 | function _deconstructPacket(data, buffers) { |
| 21 | if (!data) return data; |
nothing calls this directly
no test coverage detected