Server IP : 162.213.251.212 / Your IP : 18.117.73.46 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/home/allssztx/needapair.com/node_modules/engine.io-parser/build/cjs/ |
Upload File : |
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.encodePacket = void 0; exports.encodePacketToBinary = encodePacketToBinary; const commons_js_1 = require("./commons.js"); const encodePacket = ({ type, data }, supportsBinary, callback) => { if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) { return callback(supportsBinary ? data : "b" + toBuffer(data, true).toString("base64")); } // plain string return callback(commons_js_1.PACKET_TYPES[type] + (data || "")); }; exports.encodePacket = encodePacket; const toBuffer = (data, forceBufferConversion) => { if (Buffer.isBuffer(data) || (data instanceof Uint8Array && !forceBufferConversion)) { return data; } else if (data instanceof ArrayBuffer) { return Buffer.from(data); } else { return Buffer.from(data.buffer, data.byteOffset, data.byteLength); } }; let TEXT_ENCODER; function encodePacketToBinary(packet, callback) { if (packet.data instanceof ArrayBuffer || ArrayBuffer.isView(packet.data)) { return callback(toBuffer(packet.data, false)); } (0, exports.encodePacket)(packet, true, (encoded) => { if (!TEXT_ENCODER) { // lazily created for compatibility with Node.js 10 TEXT_ENCODER = new TextEncoder(); } callback(TEXT_ENCODER.encode(encoded)); }); }