MCPcopy Index your code
hub / github.com/socketio/socket.io / encodePacketToBinary

Function encodePacketToBinary

client-dist/socket.io.js:331–343  ·  view source on GitHub ↗
(packet, callback)

Source from the content-addressed store, hash-verified

329 }
330 var TEXT_ENCODER;
331 function encodePacketToBinary(packet, callback) {
332 if (withNativeBlob$1 && packet.data instanceof Blob) {
333 return packet.data.arrayBuffer().then(toArray).then(callback);
334 } else if (withNativeArrayBuffer$2 && (packet.data instanceof ArrayBuffer || isView$1(packet.data))) {
335 return callback(toArray(packet.data));
336 }
337 encodePacket(packet, false, function (encoded) {
338 if (!TEXT_ENCODER) {
339 TEXT_ENCODER = new TextEncoder();
340 }
341 callback(TEXT_ENCODER.encode(encoded));
342 });
343 }
344
345 // imported from https://github.com/socketio/base64-arraybuffer
346 var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

Callers 1

Calls 5

isView$1Function · 0.85
callbackFunction · 0.85
toArrayFunction · 0.85
encodePacketFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected